【oracle】oracle建立全文检索

来源:互联网 发布:hl线切割锥度编程视频 编辑:程序博客网 时间:2024/05/29 02:09
create table weibo(     weibo_id  number,     content varchar2 (4000) );

1、创建分析器

begin  ctx_ddl.create_preference ( 'crawler_chinese_lexer', 'chinese_lexer' );  end;

2、创建索引,对某个字段进行检索,则需要对该字段创建索引

create index WEIBO_TEST_INDEX on weibo(cotent) indextype is CTXSYS.CONTEXT parameters('lexer crawler_chinese_lexer ');

3、使用索引

select * from weibo where contains(content,'活动')>0

4、索引优化

beginctx_ddl.optimize_index( 'WEIBO_TEST_INDEX','full' );end;

5、索引同步

beginctx_ddl.sync_index( 'WEIBO_TEST_INDEX');end;
0 0
原创粉丝点击