Logical Operators
Use logical operators to limit your search criteria in a number of ways. Table 7-1 describes some of these operators.
Table 1 Logical Operators
| Operator | Symbol | Description | Example Expression |
|---|---|---|---|
AND |
& | Use to search for documents that contain at least one occurrence of each of the query terms. The returned score is the minimum of the operands. |
'cats AND dogs' 'cats & dogs' |
OR |
| | Use to search for documents that contain at least one occurrence of any of the query terms. The returned score is the maximum of the operands. |
'cats | dogs' 'cats OR dogs' |
NOT |
~ | Use to search for documents that contain one query term and not another. | To obtain the documents that contain the term animals but not dogs, use the following expression: 'animals ~ dogs' |
ACCUM |
, | Use to search for documents that contain at least one occurrence of any of the query terms. The accumulate operator ranks documents according to the total term weight of a document. | The following query returns all documents that contain the terms dogs, cats, and puppies, giving the highest scores to the documents that contain all three terms: 'dogs, cats, puppies' |
EQUIV |
= | Use to specify an acceptable substitution for a word in a query. | The following example returns all documents that contain either the phrase alsatians are big dogs or German shepherds are big dogs: 'German shepherds=alsatians are big dogs' |