Count specific entries in some field

Hi everyone. I have this aggregation to count the inputs in some field:

"aggs": {
        "prodt": {
            "filter": {
                "bool": {}
            },
            "aggs": {
                "prodt": {
                    "terms": {
                        "field": "product_type",
                        "size": 500
                    }
                }
            }
 }

Which will return something like this

"buckets": [
                {
                    "key": "movie",
                    "docCount": 7817
                },
                {
                    "key": "book",
                    "docCount": 2628
                },
                {
                    "key": "other",
                    "docCount": 12628
                }
]

Is there a way to do the same thing, but with actual values? For example, count only the "movie" and the "book" in field "product_type"? And will it be more efficient?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.