Search Operator Precedence
If operators are combined without parentheses, search operator precedence defines how the query is interpreted.
There are five levels of precedence, where operators on lower levels take precedence over those on higher levels. Precedence means the operator is evaluated first.
Precedence | Operators |
---|---|
1 | phrase operator: " " (Everything within the quotes is treated as plain text.) |
2 | NOT |
3 | proximity operators: /n, pre/n, /s, pre/s, /p, pre/p |
4 | AND |
5 | OR |

one OR two AND three
AND takes precedence over OR. So, the AND operator is
evaluated first, then the OR operator is evaluated on the result. This means,
the stated query is the same as
one OR (two AND three)
.
one /2 two AND three
The near operator takes precedence over the AND. Therefore, it is
evaluated as
(one /2 two) AND three
. (The alternative would
have been
one /2 (two AND three)
.)