3.初始化索引
CREATE INDEX idx_normal_content ONnormal_context(content) INDEXTYPE IS CTXSYS.CONTEXT ;
3.1. context类型的全文索引在基表数据更改的时候需要使用下面的命令同步全文索引
exec CTX_DDL.SYNC_INDEX('idx_normal_content') ;
4.查询
_dexter@FAKE> SELECT SCORE(1), id, contentFROM normal_context WHERE CONTAINS(content, 'classification', 1) > 0;
SCORE(1) ID CONTENT
---------- ------------------------------------------------------------------------------------------
10 3 Use CTXRULEindex to
build a document
classification or routing
application. This index
is created on a table of
queries, where the
queries define the
classification or routing
criteria.
_dexter@FAKE> SELECT SCORE(1), id, contentFROM normal_context WHERE CONTAINS(content, 'small documents', 1) > 0;
SCORE(1) ID CONTENT
---------- ---------- --------------------------------------------------------------------------------
5 2 Use this index typefor
better mixed query
performance. Typically,
with this index type,
you index small
documents or text
fragments. Other
columns in the base
table, such as item
names, prices, and
descriptions can be
included in the index to
improve mixed query
performance.
This index type is
transactional,
automatically updating
itself after DML to base
table. No CTX_
DDL.SYNC_INDEXis
necessary.
