Perform basic keyword searches
Use the etx_contains() operator to define, qualify, and fine-tune searches of text.
The etx_contains() operator takes three arguments: the first are two required, the third is optional. Use the first argument to specify the column that contains your search text. Use the second argument to specify what you are searching for, called a clue or a search string. The third optional argument is a statement local variable (SLV), used to return scoring information from a search.
To perform a search, use the etx_contains() operator
in the WHERE clause of a SELECT statement. For example, search the
column description for the word
multimedia
: SELECT id, description FROM videos
WHERE etx_contains(description, 'multimedia');
This example illustrates a keyword search, the default search type,
shown in the following figure. The top section of the figure shows
a table and its contents, and the bottom section shows the results
of the search.
The example query can also be specified as:
SELECT id, description FROM videos
WHERE etx_contains(description, Row('multimedia'));
This example creates the clue multimedia
by using
the Row() constructor. If you do not specify any of the tuning
parameters described in Tuning parameters, the Row() constructor
in the etx_contains() operator is optional.