Perform text search queries
To perform a text search, you use the etx_contains() operator in the WHERE clause of a SELECT statement.
multimedia document editor
,
execute the following statement: SELECT title FROM reports
WHERE etx_contains(abstract,
Row('multimedia document editor',
'SEARCH_TYPE = PHRASE_EXACT & PATTERN_ALL'));
mulitmedia document editor
, multimidia
ducument editer
, and even multimillion documentary
editorials
, although the last hit has a much lower score
than the first two hits. Since the statement specified an exact phrase
search, the search does not find documents that contain just the word multimedia
or
the phrase editorial of a multimedia event
because
of the differing order of the words multimedia
and editorial
. SELECT title FROM reports
WHERE etx_contains(abstract,
Row("*forgiv* drink*", "WILDCARD_CLUE & search_type=PHRASE_EXACT"));
This query finds unforgivable drinking
and forgiven
drinkers
. The query does not find unforgiving nondrinkers
,
since there is no * at the beginning of the clue word drink*
.
multimedia editor
or editor
of a multimedia event
. The preceding example shows that phrase
searching might not be your best choice, since the order of the words
always counts in phrase searches. Order does not count in keyword
searches because the words are treated as separate entities. Proximity
searching ensures that the keywords are close to each other. The following
is an example of a keyword proximity search: SELECT title FROM reports
WHERE etx_contains(abstract,
Row('multimedia editor',
'SEARCH_TYPE = PROX_SEARCH(5) '));
The search returns the title column of documents that contain
both the keywords multimedia
and editor
as
long as they are no more than five words apart, inclusive. This means
that the search does not return a document that contains the phrase editor
of a world class magazine known for its cutting edge articles on multimedia
because
the keywords multimedia
and editor
are
separated by more than five words.
plug and play
where the word and
is
a stopword. The text search engine by default does not search for
stopwords, so the result of the search might not be exactly what you
want. The following example shows how you can force the inclusion
of stopwords in a search: SELECT title FROM reports
WHERE etx_contains(abstract,
Row('plug and play',
'SEARCH_TYPE = PHRASE_EXACT & CONSIDER_STOPWORDS'));