Basic Text Search query terms

Query terms are words or phrases.

A word is a single word, such as Hello. A phrase is a group of words that are enclosed in double quotation marks, such as "Hello World". Multiple words or phrases can be combined with Boolean operators to form complex queries.

This example searches for the word Coastal:

bts_contains(column, 'Coastal')

This example searches for the phrase "Black and Orange":

bts_contains(column, ' "Black and Orange" ')

White space and punctuation characters are ignored. Terms within angle brackets (< >) are not interpreted as tagged HTML or XML text unless you are using XML index parameters. Letter case is not considered in query terms. Words are indexed in lowercase according to the DB_LOCALE environment variable setting. All three of the following search predicate examples search for the term orange8 in unstructured text:

bts_contains(column, ' Orange8 ')
bts_contains(column, ' <oranGe8> ')
bts_contains(column, ' "<Orange8>" ')

Grouping words and phrases

You can group words and phrases in parentheses to form more complex queries by including Boolean operators. For example, to search for words UNIX or Windows and the phrase operating system, you can use this search predicate:

bts_contains(column, ' (UNIX OR Windows) AND "operating system" ')

This search returns results that must contain the phrase operating system, and either the word UNIX or the word Windows.

You can also group words and phrases in field data:
bts_contains(column, ' os:(UNIX AND "Windows XP") ')

In that case, the search results must contain the word UNIX and the phrase Windows XP in the os field.

Escaping special characters

You can use the special characters that are part of basic text search query syntax in searches by using the backslash (\) as an escape character before the special character.

The following characters are Basic Text Search special characters: + - && || ! ( ) { } [ ] ^ " ~ * ? : \

For example, to search for the phrase (7+1), use the following search predicate:
bts_contains(column, ' \(7\+1\) ')