What does Elasticsearch auto_generate_phrase_queries do?

In the docs document for querying the query string, auto_generate_phrase_queries is specified as a parameter, but the only description is "default is false." So what does this option do?

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html

+5
source share
1 answer

This will directly correspond to lucene org.apache.lucene.queryparser.classic.QueryParserSettings#autoGeneratePhraseQueries . When the analyzer is applied to the query string, this parameter allows lucene to generate quoted phrases without keywords.

Quote :

SOLR-2015: Add the boolean attribute autoGeneratePhraseQueries to the TextField. autoGeneratePhraseQueries = "true" (default) causes the query parser to generate phrase queries if multiple tokens are generated from one string without quotes. For example, WordDelimiterFilter will split the text: pdp-11 will cause the parser to generate the text: "pdp 11" and not (text: PDP OR text: 11). Note that autoGeneratePhraseQueries = "true" tends not to work well for unsafe delimited languages.

where the word separator works like WordDelimiterFilter.html

It is important to note a single non-quoted analysis string , i.e. if the query string is not specified. If you are already looking for a quoted phrase, this makes no sense.

+5
source

Source: https://habr.com/ru/post/1212835/


All Articles