測試環境oracle11g
begin
ctx_ddl.create_preference('test_lexer', 'chinese_vgram_lexer');
--ctx_ddl.create_preference ('sms_address_lexer', 'chinese_lexer');
end;
/create index ind_t_dz on t(dz) indextype is ctxsys.context parameters ('lexer xhy.test_lexer');
--同步維護
begin
ctx_ddl.sync_index('ind_t_dz');
end;
/--優化維護
begin
ctx_ddl.optimize_index('ind_t_dz', 'fast');
end;
job:
--同步
variable jobno number;
begin
dbms_job.submit(:jobno,'ctx_ddl.sync_index(''ind_t_dz'');', sysdate, 'sysdate + (1/24/4)');
commit;
end;
--優化
variable jobno number;
begin
dbms_job.submit(:jobno,'ctx_ddl.optimize_index(''ind_t_dz'',''full'');', sysdate, 'sysdate + 1');
commit;
end;
contains關鍵用法
1: and
2: not
3: or
4: near--'a near b'
5: "good bay"是乙個片語,在單引號裡還要用雙引號括起來。
6: "a%"
7: contains( address, 'formsof (inflectional,street)' )
remark: 查詢將返回包含 'street','streets'等字樣的位址。
對於動詞將返回它的不同的時態,如:dry,將返回 dry,dried,drying 等等。
8: contains( address, 'isabout (city weight (.8), county wright (.4))' )
remark: isabout 是這種查詢的關鍵字,weight 指定了乙個介於 0~1之間的數,類似係數(我的理解)。表示不同條件有不同的側重。
oracle全文檢索
先建立個表 可見content是blob型的,本文就是給content欄位全文檢索 注 該錶名為sycontent 建立全文檢索lexer 建立全文索引時,你用的使用者必須要有ctx dll許可權,如果沒有再,在該使用者的超級管理使用者下的sysdba登入執行 grant execute on ct...
oracle全文檢索(oracle text)記錄
size large 1.全文檢索和普通檢索的區別 不使用oracle text功能,當然也有很多方法可以在oracle資料庫中搜尋文字,比如instr函式和like操作 select from mytext where instr thetext,oracle 0 select from myte...
什麼叫全文檢索 全文檢索概念
全文檢索是指計算機索引程式通過掃瞄文章中的每乙個詞,對每乙個詞建立乙個索引,指明該詞在文章中出現的次數和位置,當使用者查詢時,檢索程式就根據事先建立的索引進行查詢,並將查詢的結果反饋給使用者的檢索方式。這個過程類似於通過字典中的檢索字表查字的過程。全文檢索的方法主要分為按字檢索和按詞檢索兩種。按字檢...