elasticsearch访问max_score或访问第一个结果项

时间:2018-09-01 13:29:30

标签: elasticsearch

我想根据第一项或聚合字段或通过max_score和diff根据每个项得分来过滤结果。

例如,如何在结果过滤中访问max_score?

{
  "hits": {
    "total": 3,
    "max_score": 0.6931472,
    "hits": [
      {
        "_score": 0.6931472,
        "_source": {
          "brand": "gucci",
          "color": "green",
          "model": "slim"
        }
      }
    ]
  },
  "aggregations": {
    "max_value": {
      "value": 0.6931471824645996
    }
  }
}

0 个答案:

没有答案