@@ -86,9 +86,10 @@ query string into tokens. Defaults to the
8686`default_field`. If no analyzer is mapped, the index's default analyzer is used.
8787
8888`auto_generate_synonyms_phrase_query`::
89- (Optional, Boolean) If `true`, <<query-dsl-match-query-phrase,match phrase>>
90- queries are automatically created for multi-term synonyms. Defaults to `true`.
91- See <<simple-query-string-synonyms>> for an example.
89+ (Optional, Boolean) If `true`, the parser creates a
90+ <<query-dsl-match-query-phrase,`match_phrase`>> query for each
91+ <<token-graphs-multi-position-tokens,multi-position token>>. Defaults to `true`.
92+ For examples, see <<simple-query-string-synonyms>>.
9293
9394`flags`::
9495(Optional, string) List of enabled operators for the
@@ -273,33 +274,36 @@ GET /_search
273274<1> The `subject` field is three times as important as the `message` field.
274275
275276[[simple-query-string-synonyms]]
276- ===== Synonyms
277+ ===== Multi-position tokens
277278
278- The `simple_query_string` query supports multi-terms synonym expansion with the <<analysis-synonym-graph-tokenfilter,
279- synonym_graph>> token filter. When this filter is used, the parser creates a phrase query for each multi-terms synonyms.
280- For example, the following synonym: `"ny, new york"` would produce:
279+ By default, the `simple_query_string` query parser creates a
280+ <<query-dsl-match-query-phrase,`match_phrase`>> query for each
281+ <<token-graphs-multi-position-tokens,multi-position token>> in the query string.
282+ For example, the parser creates a `match_phrase` query for the multi-word
283+ synonym `ny, new york`:
281284
282285`(ny OR ("new york"))`
283286
284- It is also possible to match multi terms synonyms with conjunctions instead:
287+ To match multi-position tokens with an `AND` conjunction instead, set
288+ `auto_generate_synonyms_phrase_query` to `false`:
285289
286290[source,console]
287- --------------------------------------------------
291+ ----
288292GET /_search
289293{
290- "query": {
291- "simple_query_string" : {
292- "query" : "ny city",
293- "auto_generate_synonyms_phrase_query" : false
294- }
295- }
294+ "query": {
295+ "simple_query_string": {
296+ "query": "ny city",
297+ "auto_generate_synonyms_phrase_query": false
298+ }
299+ }
296300}
297- --------------------------------------------------
301+ ----
298302
299- The example above creates a boolean query:
303+ For the above example, the parser creates the following
304+ <<query-dsl-bool-query,`bool`>> query:
300305
301306`(ny OR (new AND york)) city)`
302307
303- that matches documents with the term `ny` or the conjunction `new AND york`.
304- By default the parameter `auto_generate_synonyms_phrase_query` is set to `true`.
305-
308+ This `bool` query matches documents with the term `ny` or the conjunction
309+ `new AND york`.
0 commit comments