设为首页 加入收藏

TOP

Oracle全文检索方面的研究(全1)(二)
2014-11-24 08:12:01 来源: 作者: 【 】 浏览:4
Tags:Oracle 全文检索 面的 研究
a, 1, 400, 24-oct-2002);

Insert into auction values(2, olympus camera, 1, 300, 25-oct-2002);

Insert into auction values(3, pentax camera, 1, 200, 26-oct-2002);

Insert into auction values(4, canon camera, 1, 250, 27-oct-2002);

Commit;

/

--确定你的查询条件(很重要)

--Determine that all queries search the title column for item descriptions

--建立索引集

begin

ctx_ddl.create_index_set(auction_iset);

ctx_ddl.add_index(auction_iset,price); /* sub-index a*/

end;

--建立索引

Create index auction_titlex on auction(title) indextype is ctxsys.ctxcat

parameters (index set auction_iset);

Column title format a40;

Select title, price from auction where catsearch(title, camera, order by price)> 0;

Title price

--------------- ----------

Pentax camera 200

Canon camera 250

Olympus camera 300

Nikon camera 400

Insert into auction values(5, aigo camera, 1, 10, 27-oct-2002);

Insert into auction values(6, len camera, 1, 23, 27-oct-2002);

commit;

/

--测试索引是否自动同步

Select title, price from auction where catsearch(title, camera,

price <= 100)>0;

Title price

--------------- ----------

aigo camera 10

len camera 23

添加多个子查询到索引集:

begin

ctx_ddl.drop_index_set(auction_iset);

ctx_ddl.create_index_set(auction_iset);

ctx_ddl.add_index(auction_iset,price); /* sub-index A */

ctx_ddl.add_index(auction_iset,price, bid_close); /* sub-index B */

end;

drop index auction_titlex;

Create index auction_titlex on auction(title) indextype is ctxsys.ctxcat

parameters (index set auction_iset);

SELECT * FROM auction WHERE CATSEARCH(title, camera,price = 200 order by bid_close)>0;

SELECT * FROM auction WHERE CATSEARCH(title, camera,order by price, bid_close)>0;

任何的Dml 操作后,Ctxcat 的索引会自动进行同步,不需要手工去执行,与ctxcat 索引相对应的查询操作符是catsearch.

语法:

Catsearch(

[schema.]column,

Text_query varchar2,

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Oracle全文检索方面的研究(全3) 下一篇Oracle全文检索方面的研究(全4)

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·MySQL 基础入门视频 (2025-12-26 23:20:22)
·小白入门:MySQL超详 (2025-12-26 23:20:19)
·关于 MySQL 数据库学 (2025-12-26 23:20:16)
·SOLVED: Ubuntu 24.0 (2025-12-26 22:51:53)
·Linux 常用命令最全 (2025-12-26 22:51:50)