The proximity operators,
NEAR
and
ONEAR
, let users search for a pair of terms that must
occur within a given distance from each other in a document.
The document is matched if both terms are present in the document, and if the terms are within the specified number of words from each other.
Wildcards are not supported in term specifications.
The syntax for using the proximity operators is as follows:
term1 NEAR/num term2 term1 ONEAR/num term2
In this example:
Each term (
term1
andterm2
) can be a single word or a multi-word phrase (which must be specified within quotation marks).The
num
parameter is an integer that specifies the maximum number of words between the two terms. That is, ifnum
is 5, thenterm1
andterm2
can be separated by no more than five words.