我想知道,是否有像字符串过滤器这样的选项?
我最近遇到以下错误:
RequestError(400, 'search_phase_execution_exception', 'too_many_clauses: maxClauseCount is set to 1024')
根据Lucene的文档,它说:
使用过滤器替换查询中导致异常的部分。
你有什么想法?
最佳答案
Lucene常见问题解答中提到了几种克服TooManyClauses异常的方法,该方法不适用于Elasticsearch,因为以前它们曾经分别拥有terms filter,但是现在它是术语查询的一部分。
因此,下面是示例如何在过滤器上下文中使用术语的示例:
{
"query": {
"bool": {
"filter": [
{ "term": { "user" : ["kimchy", "elasticsearch"]},
]
}
}
}
如果您确实需要使用查询而不是过滤器,则可以更新
集群每个节点的elasticsearch.yml文件中的
indices.query.bool.max_clause_count: n
(将n替换为所需的子句数),然后重新启动集群。Note that this will increase the memory requirements for searches that expand to many terms.
关于elasticsearch - Elasticsearch 字符串过滤器-是否存在这样的选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53611639/