1.给指定用户(tecamocmsuser)授权(ctxappexecute on ctx_ddl

grant ctxapp to tecamocmsuser;

 

grant execute on ctx_ddl to tecamocmsuser;

 

2创建分词

 

ctx_ddl.create_preference ('my_LEXER', 'chinese_vgram_lexer');

 

3创建索引

CREATE INDEX INX_Archive ON CMS_ODDITIONAL_ARTICLE (body) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS ('LEXER  my_LEXER ');

4.数据同步

create or replace procedure PROC_SYNC_FULLTEXT

is

begin

ctx_ddl.sync_index('INX_Archive');

ctx_ddl.optimize_index('INX_Archive','FULL');

end;

5.定时同步

BEGIN

DBMS_JOB.ISUBMIT(job=>1010,what => 'begin PROC_SYNC_FULLTEXT ();end;',

next_date => SYSDATE, interval => 'SYSDATE + (1/24/12)');

commit;

END;

6.使用查询

select id from cms_odditional_article  where contains (body, '广州')>1;

 

相关文章:

  • 2021-05-28
  • 2022-03-01
  • 2021-08-18
  • 2021-05-23
  • 2021-05-16
  • 2022-12-23
  • 2022-02-23
  • 2022-12-23
猜你喜欢
  • 2021-10-06
  • 2022-12-23
  • 2021-05-09
  • 2021-11-03
  • 2022-12-23
  • 2021-12-19
  • 2022-01-12
相关资源
相似解决方案