TEXT Queries

This chapter describes queries that use Tibero TEXT functions.

CATSEARCH

The CATSEARCH function is used in a WHERE clause of a SELECT statement to use CTXCAT indexes.

Usage

CATSEARCH( column, text_query, reserved argument)
Item
Description

column

Column that has a CTXCAT index.

text_query

CATSEARCH query operation, which defines the text to search for.

reserved argument

Reserved for future functionality.

CATSEARCH query operations

The CATSEARCH query supports the following six operations.

Operation
Syntax Example
Description

Logical AND

a b c

Searches for rows that include a, b, and c.

Logical OR

a | b | c

Searches for rows that include a, b, or c.

Logical NOT

a - b

Searches for rows that include a but do not include b.

Cannot be used alone.

" "

"a b c"

Searches for rows that include a phrase "a b c".

( )

(a b) | c

Specifies the priority of operations.

In the example, a b is calculated first, and then | c is calculated.

Wildcard

ab*, a*b, *ab

* represents zero or more arbitrary characters.

Return Values

Return values are NUMBERs that have no meaning.

Examples

The following example creates a table and a CTXCAT index.

The following example inserts data to the table.

The following example searches for data.


CONTAINS

The CONTAINS function is used in a WHERE clause of a SELECT statement to use CONTEXT indexes.

Usage

Item
Description

column

Column that has a CONTEXT index.

text_query

CONTAINS query operation, which defines the text to search for.

reserved argument

Reserved for future functionality.다.

CONTAINS query operations

The CONTAINS query supports the following six operations.

Operation
Syntax Example
Description

Logical AND

a AND b

Searches for rows that include a, b, and c.

Logical OR

a OR b, a | b

Searches for rows that include a or b.

Logical NOT

a ~ b

Searches for rows that include a but do not include b.

SEQUENCE

a b

Searches for rows that include the phrase of a b.

Wildcard

ab%, %ab

% represents zero or more arbitrary characters.

WITHIN

a WITHIN SENTENCE, a WITHIN PARAGRAPH

Searches for rows containing a sentence or paragraph that includes a.

Return Values

Return values are NUMBERs that have no meaning.

Examples

The following example creates a table and a CONTEXT index and inserts data to the table.

The following example searches for data.

The following example searches for data by using the WITHIN operator. WHITESPACE must be set for the LEXER property.

For more information about this, please refer to “TEXT Indexing Elements”.

Last updated