Create User:
http://sadatdba.blogspot.com/2008/12/steps-to-use-oracle-text.html
Create the Rule Table:
CREATE TABLE queries (query_id NUMBER,query_string VARCHAR2(80));
INSERT INTO queries VALUES (1, 'oracle');
INSERT INTO queries VALUES (2, 'larry or ellison');
INSERT INTO queries VALUES (3, 'oracle and text');
INSERT INTO queries VALUES (4, 'market share');
Create Your CTXRULE Index:
CREATE INDEX queryx ON queries(query_string) INDEXTYPE IS CTXRULE;
Classify with MATCHES:
COLUMN query_string FORMAT a35;
SELECT query_id,query_string FROM queries WHERE MATCHES(query_string, 'Oracle announced that its market share in databases increased over the last year.')>0;
QUERY_ID QUERY_STRING
---------- -----------------------------------
1 oracle
4 market share
No comments:
Post a Comment