Py学习  »  Elasticsearch

Elasticsearch筛选具有相同字段值的文档ID计数

Iwavenice • 4 年前 • 460 次点击  

我需要返回相同myField值重复[range]次的文档的id。

我有以下疑问

_search?filter_path=hits.total,hits.hits._id


"query": {
    some filters that return matching document ids
 },
"post_filter": {
    "bool": {
        "should": [
            {
                "range": {
                    "myField": {
                        "lte": 3,
                        "gte": 2
                    }
                }
            }
        ],
        "minimum_should_match": 1
    }
}

但它返回myField值的范围,而不是myField值的计数。 如何修改post_过滤器以获得所需的结果?

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/56922
 
460 次点击  
文章 [ 1 ]  |  最新文章 4 年前