Elasticsearch:如何 return 聚合中的所有方面值

Elasticsearch: how to return all facet values in an aggregation

我正在通过阅读名为 Elasticsearch Cookbook(第 2 版)的书来学习 Elasticsearch。它具有以下示例查询:

{
    "query": {
        "match_all": {}
    },
    "aggs": {
        "tag": {
            "terms": {
                "field": "tag",
                "size": 10
            }
        }
    }
}

根据这本书,

size (by default 10): This controls the number of facets value that is to be returned.

我很好奇:如果我事先不知道分面值的总数,如何return所有分面值?

对不起,如果我的问题很明显。

感谢和问候。

将大小设置为 0(与将其设置为 Integer.MAX_VALUE 相同)

不过要小心,因为如果你有很多分面值,这会表现得很糟糕。

http://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html