CONTAINS Operator

Selects documents by matching the word or phrase you specify with values stored in a specific document field. When you use the CONTAINS operator, you specify the field name to search, and the word or phrase to search for.

With the CONTAINS operator, the words stored in a document field are interpreted as individual, sequential units. You may specify one or more of these units as search criteria. To specify multiple words, each word must be sequential and contiguous, and must be separated by a blank space. Use CONTAINS with the FILTER operator.

The syntax for CONTAINS is the same as that for MATCHES. See the example for MATCHES under the topic "visual arts" in "Sample Topic Outlines." The example assumes that the field TITLE has been created for the collection.

The CONTAINS operator does not recognize non-alphanumeric characters. The CONTAINS operator interprets non-alphanumeric characters as a space and treats the separated values as individual units. For example, if you have defined a slash (/) as a valid character, and you enter search criteria that include this character, as in OS/2, "OS" and "2" are treated as individual units.

Note that the CONTAINS operator does not refer to the style.lex file for the definition of which characters are included in a word.