手机版
你好,游客 登录 注册
背景:
阅读新闻

Oracle Text 全文索引 几种典型应用场景

[日期:2012-12-28] 来源:Linux社区  作者:renfengjun [字体:大 中 小]

一、普通查询

这是OracleText比较普遍且常用的应用场景。创建OracleText中Context类型的索引,生成大量的关键词,用于加快类似于普通的like ‘%xx%’操作速度,或者查询一些比较大的文档。可以使用contains函数进行数据检索。缺点:比较依赖于关键词和文档格式。有时可能不太准确。

以下为简单示例,这里不必多说,只是简单查询场景:

1.创建表

create table normal_context( id number , contentclob ) ;

2.初始化数据

insert into normal_context values(1 , ' Use thisindex to build a
                                  textretrieval application
                                  when your text consists
                                  of largecoherent
                                  documents.You can
                                  indexdocuments of
                                  differentformats such as
                                  MS Word, HTMLor
                                  plain text.
                                  You cancustomize the
                                  index in avariety of
                                  ways.
                                  This index typerequires
                                CTX_DDL.SYNC_INDEX
                                  after DML onbase table.') ;
insert into normal_context values(2 ,'Use thisindex type for
                                better mixed query
                                performance.Typically,
                                with this indextype,
                                you index small
                                documents ortext
                              fragments.Other
                                columns in thebase
                                table, such asitem
                                names, prices,and
                                descriptionscan be
                                included in the indexto
                                improve mixedquery
                                performance.
                                This index typeis
                                transactional,
                                automaticallyupdating
                                itself afterDML to base
                                table. No CTX_
                              DDL.SYNC_INDEXis
                                necessary.') ;
 
 
insert into normal_context values(3 , ' UseCTXRULEindex to
                                  build adocument
                                classification or routing
                                  application.This index
                                  is created on a table of
                                  queries,where the
                                  queriesdefine the
                                classification or routing
                                  criteria.') ;
insert into normal_context values(4 , ' Createthis index when
                                  you need tospeed up
                                existsNode()queries
                                  on anXMLTypecolumn.') ;

linux
相关资讯       Oracle索引  Oracle Text 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款