Limit ElasticSearch aggregation to top n query results

后端 未结 3 552
粉色の甜心
粉色の甜心 2020-12-09 17:24

I have a set of 2.8 million docs with sets of tags that I\'m querying with ElasticSearch, but many of these docs can be grouped together by one ID. I want to query my data u

3条回答
  •  既然无缘
    2020-12-09 18:08

    You can use the min_doc_count parameter

    {
    "aggs" : {
        "products" : {
            "terms" : {
                "field" : "product",
                "min_doc_count" : 100
                      }
                     }
             }
    }
    

提交回复
热议问题