ルールが生成されると、ユーザーは最初の索引付けでルールをテストし、次にMATCHES
を使用して新規ドキュメントを分類できます。このプロセスは、次のとおりです。
CTXRULE索引を作成するルールの索引付け
CREATE INDEX
を使用し、以前に生成したルールにCTXRULE
索引を作成します。
create index rules_idx on rules (rule_text) indextype is ctxsys.ctxrule;
MATCHESを使用した着信ドキュメントのテスト
set serveroutput on;
declare incoming_doc clob; begin incoming_doc := 'I have spent my entire life managing restaurants selling burgers'; for c in ( select distinct cd_description from rules, category_descriptions where cd_category = rule_cat_id and matches (rule_text, incoming_doc) > 0) loop dbms_output.put_line('CATEGORY: '||c.cd_description); end loop; end; /