@@ -235,26 +235,10 @@ states that:
235
235
* `news` must not be present
236
236
* `quick` and `brown` are optional -- their presence increases the relevance
237
237
238
- The familiar operators `AND`, `OR` and `NOT` (also written `&&`, `||` and `!`)
239
- are also supported. However, the effects of these operators can be more
240
- complicated than is obvious at first glance. `NOT` takes precedence over
241
- `AND`, which takes precedence over `OR`. While the `+` and `-` only affect
242
- the term to the right of the operator, `AND` and `OR` can affect the terms to
243
- the left and right.
244
-
245
- ****
246
- Rewriting the above query using `AND`, `OR` and `NOT` demonstrates the
247
- complexity:
248
-
249
- `quick OR brown AND fox AND NOT news`::
250
-
251
- This is incorrect, because `brown` is now a required term.
252
-
253
- `(quick OR brown) AND fox AND NOT news`::
254
-
255
- This is incorrect because at least one of `quick` or `brown` is now required
256
- and the search for those terms would be scored differently from the original
257
- query.
238
+ The familiar boolean operators `AND`, `OR` and `NOT` (also written `&&`, `||`
239
+ and `!`) are also supported but beware that they do not honor the usual
240
+ precedence rules, so parentheses should be used whenever multiple operators are
241
+ used together. For instance the previous query could be rewritten as:
258
242
259
243
`((quick AND fox) OR (brown AND fox) OR fox) AND NOT news`::
260
244
0 commit comments