绊脚石乃是进身之阶。

es query multi_match 之后结果 想group by having 如何操作 求个样例

Elasticsearch | 作者 devilhookey | 发布于2016年11月10日 | 阅读数:5600

{
  "query": {
    "multi_match": {
      "query": "查点什么",
      "fields": [
        "title",
        "name",
        "mode",
        "color",
        "remark",
        "username",
        "other"
      ],
      "analyzer": "ik_syno_smart",
      "minimum_should_match": "90%"
    }
  },
  "min_score": 1,
  "sort": [
    {
      "uid": {
        "order": "desc"
      }
    }
  ],
  "aggs": {
    "uids": {
      "terms": {
        "field": "uid",
        "size": 0
      },
      "aggs": {
        "having": {
          "bucket_selector": {
            "buckets_path": {
              "uids_count": "_count"
            },
            "script": {
              "lang": "expression",
              "inline": " uids_count < 2"
            }
          }
        }
      }
    }
  },
  "size": 10
}
上面是测试时候的,但是结果并不对 求各路大神显灵
已邀请:

fox3012

赞同来自:

请问multi_match后加上aggs 后,得到的hit里面的数据和aggs里面的数据不匹配;如何解决这个问题

要回复问题请先登录注册