【问题标题】:Filter vs query behaviour in constant_scoreconstant_score 中的过滤器与查询行为
【发布时间】:2017-10-24 05:57:36
【问题描述】:

当包装在 constant_score 复合查询中时,我对过滤器和查询的行为之间的差异感到困惑。
两者都给了我 1 分,而对所有文档都没有任何提升。但是文档说当我们在 constant_score 中使用过滤器子句时,过滤器上下文被激活。
如果我在 constant_score 下使用查询参数获得所有文档的恒定分数,则意味着查询仅在过滤器上下文中运行。那么为什么文档在 constant_score 中特别提到了 filter 参数呢?我错过了什么?

【问题讨论】:

    标签: elasticsearch


    【解决方案1】:

    您应该阅读这部分文档:

    https://www.elastic.co/guide/en/elasticsearch/reference/5.5/query-filter-context.html

    https://www.elastic.co/guide/en/elasticsearch/reference/5.5/query-dsl-constant-score-query.html

    Elasticsearch 为您提供了很好的解释。

    但是,过滤掉 constant_score 将返回所有匹配它们的值。在constant_point中过滤,返回过滤的结果,受constant_score限制。

    问候。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-01-13
      • 2013-07-18
      • 2012-02-02
      • 1970-01-01
      • 2018-11-15
      • 1970-01-01
      • 2014-12-13
      相关资源
      最近更新 更多