Partager via


CONTAINS Operator

Note

Indexing Service is no longer supported as of Windows XP and is unavailable for use as of Windows 8. Instead, use Windows Search for client side search and Microsoft Search Server Express for server side search.

 

The CONTAINS operator indicates a search for any of the specified words or phrases within a particular property. If no operator is specified, the CONTAINS operator is assumed. The CONTAINS operator contrasts with the relational operator "equals to" (=), which requires a match of the specified words or phrases and only those words or phrases. The CONTAINS operator is available only in its English spelling.

The following examples illustrate the use of the CONTAINS operator.

To Search For Example Results
Documents that contain any of the terms.
{prop name=Contents} Contains {freetext} big red truck {/freetext}
—Or—
$Contents contains big red truck
—Or—
$Contents big red truck
Documents whose contents property contains the terms big, red, or truck.
Documents that contain a phrase.
{prop name=All} Contains {phrase} big red truck {/phrase}{/prop}
—Or—
@All contains "big red truck"
—Or—
@All "big red truck"
Documents with any property that contains the phrase big red truck.