The CTXCAT Grammar

The CTXCAT grammar is the default grammar for CATSEARCH. This grammar supports logical operations, such as AND and OR, as well as phrase queries.

The CATSEARCH query operators have the following syntax:

Table 2 CATSEARCH Query Operator Syntax

Operation Syntax Description of Operation
Logical AND a b c Returns rows that contain a, b and c.
Logical OR a | b | c Returns rows that contain a, b, or c.
Logical NOT a - b Returns rows that contain a and not b.
hyphen with no space a-b

Hyphen treated as a regular character.

For example, if you define the hyphen as a skipjoin, then words such as vice-president are treated as the single query term vicepresident.

Likewise, if you define the hyphen as a printjoin, then words such as vice-president are treated as vice president with the space in the CTXCAT query language.

ā€ ā€œ ā€œa b cā€

Returns rows that contain the phrase "a b c."

For example, entering "Sony CD Player" means return all rows that contain this sequence of words.

( ) (A B) | C Parentheses group operations. This query is equivalent to the CONTAINS query (A &B) | C.

To use the CONTEXT grammar in CATSEARCH queries, use a query template specification in the text_query parameter.

You might use the CONTAINS grammar as such when you need to enter proximity, thesaurus, or ABOUT queries with a CTXCAT index.

See Also: Oracle Text Reference for more information about using these operators