Elasticsearch 的 auto_generate_phrase_queries 有什么作用?
What does Elasticsearch's auto_generate_phrase_queries do?
在查询字符串查询的文档中,auto_generate_phrase_queries
被列为参数,但唯一的描述是"defaults to false."那么这个参数到底是做什么的?
这将直接匹配到 lucene 的 org.apache.lucene.queryparser.classic.QueryParserSettings#autoGeneratePhraseQueries
。当分析器应用于查询字符串时,此设置允许 lucene 生成无关键字的引用短语。
SOLR-2015: Add a boolean attribute autoGeneratePhraseQueries to TextField.
autoGeneratePhraseQueries="true" (the default) causes the query parser to
generate phrase queries if multiple tokens are generated from a single
non-quoted analysis string. For example WordDelimiterFilter splitting text:pdp-11
will cause the parser to generate text:"pdp 11" rather than (text:PDP OR text:11).
Note that autoGeneratePhraseQueries="true" tends to not work well for non whitespace
delimited languages.
其中单词分隔符用作 WordDelimiterFilter.html
需要注意的重要事项是 single non-quoted analysis string
,即如果您的查询字符串未被引号括起来。如果您已经在搜索引用的短语,那么它没有任何意义。
在查询字符串查询的文档中,auto_generate_phrase_queries
被列为参数,但唯一的描述是"defaults to false."那么这个参数到底是做什么的?
这将直接匹配到 lucene 的 org.apache.lucene.queryparser.classic.QueryParserSettings#autoGeneratePhraseQueries
。当分析器应用于查询字符串时,此设置允许 lucene 生成无关键字的引用短语。
SOLR-2015: Add a boolean attribute autoGeneratePhraseQueries to TextField. autoGeneratePhraseQueries="true" (the default) causes the query parser to generate phrase queries if multiple tokens are generated from a single non-quoted analysis string. For example WordDelimiterFilter splitting text:pdp-11 will cause the parser to generate text:"pdp 11" rather than (text:PDP OR text:11). Note that autoGeneratePhraseQueries="true" tends to not work well for non whitespace delimited languages.
其中单词分隔符用作 WordDelimiterFilter.html
需要注意的重要事项是 single non-quoted analysis string
,即如果您的查询字符串未被引号括起来。如果您已经在搜索引用的短语,那么它没有任何意义。