当前位置:操作系统 > Unix/Linux >>

全文检索语句

全文检索语句
 
BEGIN
 CTX_DDL.CREATE_PREFERENCE('ADDRESS_CHINESE_LEXER', 'CHINESE_LEXER');
 CTX_DDL.CREATE_PREFERENCE('ADDRESS_WORDLIST', 'BASIC_WORDLIST');
 CTX_DDL.SET_ATTRIBUTE('ADDRESS_WORDLIST', 'SUBSTRING_INDEX', 'TRUE');
 CTX_DDL.SET_ATTRIBUTE('ADDRESS_WORDLIST', 'PREFIX_INDEX', 'TRUE');
 CTX_DDL.SET_ATTRIBUTE('ADDRESS_WORDLIST', 'FUZZY_SCORE', '0');
 CTX_DDL.SET_ATTRIBUTE('ADDRESS_WORDLIST', 'FUZZY_NUMRESULTS', '5000');
 CTX_DDL.SET_ATTRIBUTE('ADDRESS_WORDLIST', 'FUZZY_MATCH', 'CHINESE_VGRAM');
 ctx_ddl.set_attribute('ADDRESS_WORDLIST', 'wildcard_maxterms',15000) ;
END;
/

create index idxd_install_address on t_install_addresss(ADDRESS) indextype is ctxsys.context
parameters ( 'DATASTORE CTXSYS.DIRECT_DATASTORE FILTER CTXSYS.NULL_FILTER LEXER ADDRESS_CHINESE_LEXER WORDLIST ADDRESS_WORDLIST') parallel 12;
alter index idxd_install_address noparallel;


create index idxd_post_address on t_postinfos(ADDRESS) indextype is ctxsys.context
parameters ( 'DATASTORE CTXSYS.DIRECT_DATASTORE FILTER CTXSYS.NULL_FILTER LEXER ADDRESS_CHINESE_LEXER WORDLIST ADDRESS_WORDLIST') parallel 12;
alter index idxd_post_address noparallel;

create or replace procedure PROC_SYNC_OPTIMIZE is
begin
       ctx_ddl.sync_index('idxd_install_address');
       ctx_ddl.optimize_index('idxd_install_address','FULL');
       ctx_ddl.sync_index('idxd_post_address');
       ctx_ddl.optimize_index('idxd_post_address','FULL');
end;
/

begin
  sys.dbms_scheduler.create_job(job_name            => 'DVTEBOSS.DOMAIN_INDEX_SYNC',
                                job_type            => 'STORED_PROCEDURE',
                                job_action          => 'PROC_SYNC_OPTIMIZE',
                                start_date          => to_date('02-03-2012 00:00:00', 'dd-mm-yyyy hh24:mi:ss'),
                                repeat_interval     => 'Freq=Minutely;Interval=5',
                                end_date            => to_date(null),
                                job_class           => 'DEFAULT_JOB_CLASS',
                                enabled             => true,
                                auto_drop           => false,
                                comments            => '全文索引同步');
                                
   sys.dbms_scheduler.run_job(job_name => 'DVTEBOSS.DOMAIN_INDEX_SYNC');
end;
/

 


CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,