Elasticsearch filter aggregations on minimal doc count

我们两清 提交于 2019-12-04 02:55:26

Next time, M'sieur Toph' : RTFM !!!

I feel really dumb: I found the anwser in the manual, 30 seconds after asking. I don't remove my question because, it can help, who knows...

Here is the anwser :

You can specify the min_doc_count property in the terms aggregation.

It gives you :

{
    ...
    aggs: {
        field1: {
            terms: {
                field: 'field1',
                min_doc_count: 1000
            },
            aggs: {
                field2: {
                    terms: {
                        field: 'field2',
                        min_doc_count: 1000
                    }
                }
            }
        }
    }
}

You also can specify a specific minimal count for each level of your aggregation.

What else ? :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!