Académique Documents
Professionnel Documents
Culture Documents
By value method
SQL>
select * from books where contains(info, property
AND
harvests
AND
workers) > 0;
SQL>
select * from books where catsearch(info, property harvests
workers, null) > 0;The following queries will search for either of the
two words.
SQL>
select * from books where contains(info, property
OR
harvests) > 0;Instead of
OR
you can use a vertical line (|).
SQL>
select * from books where contains(info, property
|
harvests) > 0;
SQL>
select * from books where catsearch(info, property
|
harvests, null) > 0;In the following queries the
ACCUM
(accumulate) operator adds together the scores of theindividual
searches and compares the accumulated score to the threshold value.
SQL>
select * from books where contains(info, property
ACCUM
harvests) > 0;
SQL>
select * from books where catsearch(info, property
ACCUM
harvests, null) > 0;Instead of
OR
you can use a comma(,).
SQL>
select * from books where contains(info, property , harvests)
> 0;
SQL>
select * from books where catsearch(info, property , harvests,
null) > 0;In the following queries the
MINUS
operator subtracts the score of the second terms searchfrom
the score of the first terms search.
SQL>
select * from books where contains(info, property
MINUS
harvests) > 0;
SQL>
select * from books where catsearch(info, property
NOT
harvests, null) > 0;Instead of
MINUS
you can use and instead of
NOT
you can use ~.
SQL>
select * from books where contains(info, property
harvests) > 0;
SQL>
SYNC_INDEX
procedure of the
CTX_DDL
package.
SQL>
exec
CTX_DDL.SYNC_INDEX
(book_index);
INDEX SETS
Historically, problems with queries of text indexes have
occurred when other criteria areused alongside text
searches as part of the where clause. To improve the
mixed querycapability, oracle features index sets. The indexes
within the index set may be structuredrelational columns or on
text columns.To create an index set, use the
CTX_DDL
package to create the index set and add indexes toit. When you
create a text index, you can then specify the index set it
belongs to.
SQL>
exec
CTX_DDL.CREATE_INDEX_SET
(books_index_set);The add non-text indexes.
SQL>
exec
CTX_DDL.ADD_INDEX
(books_index_set, title_index);Now create a
CTXCAT
text index. Specify ctxsys.ctxcat as the index type, and list the
indexset in the parameters clause.
SQL>
create index book_index on books(info) indextype is
ctxsys.ctxcatparameters(index set books_index_set);
136
Local keyword tells oracle to create a separte index for each partition.
The global clause allows you to create a non-partitioned index.