elasticsearch - Elasticsearch bool过滤器和minimum_should_match选项

标签 elasticsearch

我有以下情况-我需要将bool查询更改为过滤器,以检查其速度是否更快。
问题是,我们经常使用minimum_should_match参数,通常使用1或0作为值。 bool(boolean) 过滤器显然不支持minimum_should_match-它给了我nested: QueryParsingException[[index_name] [bool] filter does not support [minimum_should_match]错误。那我该怎么办?有什么解决方法吗?我们使用Elasticsearch 1.7.1

最佳答案

在典型情况下,您不需要minimum_should_match

这可能无法完全回答您的问题,因为这仅是01的解决方案。

我不知道它不受支持。但是,请注意,对于10,您不需要此选项,因为默认值为1,而0为无效;它被忽略,就好像它是1。从docs:

No matter what number the calculation arrives at, a value greater than the number of optional clauses, or a value less than 1 will never be used. (ie: no matter how low or how high the result of the calculation result is, the minimum number of required matches will never be lower than 1 or greater than the number of clauses.

关于elasticsearch - Elasticsearch bool过滤器和minimum_should_match选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32568802/

相关文章:

Elasticsearch 5.0.2 ignore_above 给出不受支持的参数错误

amazon-web-services - AWS Elasticsearch : How to move data from one index into another

python - 处理 Elasticsearch 异常

elasticsearch - 按桶键值过滤 Elasticsearch 聚合

elasticsearch - function_score尝试在Elasticsearch中使用排除索引中的字段

elasticsearch - 平面文档与嵌套文档的性能缺陷是什么?

java - 通过java api更新elasticsearch中的索引时文档丢失异常

node.js - 如何在Elastic的updateByQuery中 “throw”自定义错误消息

docker - LogStash 无法从许可证中检索许可证信息。响应代码 '401' 通过 URL 'http://elasticsearch:9200/_xpack' 联系 Elasticsearch

java - 如何使用 spring-data-elasticsearch 在 elasticsearch 中进行集成测试?