Oracle Text работа с контекстными индексами

CREATE TABLE tz_docs ( doc_id NUMBER ( 10 ), vc2doc VARCHAR2 ( 4000 ) ); 
INSERT INTO tz_docs VALUES ( 1, 'Mary had a little lamb' );
INSERT INTO tz_docs VALUES ( 2, 'Twinkle, twinkle little star' );
INSERT INTO tz_docs VALUES ( 3, 'This Lamb is my lamb' );
CREATE INDEX docs_vc2doc_idx ON tz_docs (vc2doc) INDEXTYPE IS ctxsys.context; 
SELECT * FROM tz_docs;
SELECT * FROM tz_docs WHERE CONTAINS ( vc2doc, 'LaMb' );
SELECT CONTAINS ( vc2doc, 'MARY AND LAMB' ) AS score1 , vc2doc FROM tz_docs;
SELECT CONTAINS ( vc2doc, 'MaRy AnD lAmB' ) AS score1 , vc2doc FROM tz_docs;
SELECT CONTAINS ( vc2doc, '%le' ) AS score1 , vc2doc FROM tz_docs;
SELECT CONTAINS ( vc2doc, 'lamb NOT mary' ) AS score1 , vc2doc FROM tz_docs;
SELECT CONTAINS ( vc2doc, 'NEAR ((lamb, mary) ,3)' ) AS score1 , vc2doc FROM tz_docs;
SELECT CONTAINS ( vc2doc, 'NEAR ((lamb, mary) ,2)' ) AS score1 , vc2doc FROM tz_docs;
SELECT CONTAINS ( vc2doc, 'mary ACCUM lamb' ) AS score1 , vc2doc FROM tz_docs;
SELECT CONTAINS ( vc2doc, 'mary ACCUM little' ) AS score1 , vc2doc FROM tz_docs;
SELECT CONTAINS ( vc2doc, 'mary ACCUM little lamb' ) AS score1 , vc2doc FROM tz_docs;
SELECT CONTAINS ( vc2doc, 'lamb OR little' ) AS score1 , vc2doc FROM tz_docs;
14:20
100
Нет комментариев. Ваш будет первым!
Загрузка...