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