Keyword searches
When the clue you specify contains more than one word, you can direct the search engine to treat each word as a separate entity. This type of search is called a keyword search. When the text search engine performs a keyword search, it returns a row whenever it encounters one or more of the words in your clue.
WORD
and passing it to the search engine as
the second parameter of the Row() constructor. For
example, the following query instructs the search engine to return
any row that contains one or more occurrences of the keywords multimedia
, document
,
or editor
in the description column:
SELECT id, description FROM videos
WHERE etx_contains (description,
Row('multimedia document editor', 'SEARCH_TYPE = WORD'));
The search did not return the row with ID 1003 because the word multimedia
is
misspelled and the text does not contain the other two words in the clue. Even
though the word multimedia
is misspelled in the row with
ID 1004, the row is still returned because it contains the other two
words in the clue, document
and editor
.
The search engine assigns the rows returned by a keyword search a document score. The document score is based on the number of keywords found in a document. For example, a document that contains two of three keywords is scored twice as high as a document that contains only one of the keywords.
SELECT id, description FROM videos
WHERE etx_contains (description,
Row('multimedia document editor'));
SELECT id, description FROM videos
WHERE etx_contains (description,
Row('multimedia document editor', 'SEARCH_TYPE = WORD'));