This topic contains examples of using proximity operators with nested sub-expressions.
(chardonnay NEAR/5 California) AND Sonomais a valid expression because NEAR is being used as a sub-expression to the AND operator.
However, you cannot use the non-proximity operators (AND, OR, NOT) as sub-expressions to the NEAR and ONEAR operators.
(chardonnay OR merlot) NEAR/5 Californiais not a valid expression.
(chardonnay NEAR/5 California) OR (merlot NEAR/5 California)
The proximity operators are therefore leaf operators. That is, they accept only words and phrases as sub-expressions, but not the other Boolean operators.
Using proximity operators with the key restrict operator also has the same limitations when used as sub-expressions.
("car maker" : aston) NEAR/3 martinis not valid.
However, the following format for a key restrict operator is acceptable:
"car maker" : (aston NEAR/3 martin)