Aggregating over _field_names in elasticsearch 5

后端 未结 2 1578
孤街浪徒
孤街浪徒 2021-01-23 10:32

I\'m trying to aggregate over field names in ES 5 as described in Elasticsearch aggregation on distinct keys But the solution described there is not working anymore.

My

2条回答
  •  误落风尘
    2021-01-23 11:22

    This is probably because setting size: 0 is not allowed anymore in ES 5. You have to set a specific size now.

    POST _search
    {
        "aggs": {
            "params": {
                "terms": {
                    "field": "_field_names",
                    "include" : "param.*",   
                    "size": 100                <--- change this
                }
    
            }
        }
    }
    

提交回复
热议问题