Sub Aggregating a terms Bucket Aggregation

Hello,
I have a bool Query which gives me results and terms bucket Aggregation on one of the Fields.
is there a way to Aggregate each Bucket item with Date Histogram aggregation

{
    "size": 10,
    "query": {
        "bool": {
            "must": [
                {
                    "multi_match": {
                        "query": "welding",
                        "type": "phrase",
                        "fields": [
                            "title^10",
                            "abstraction"
                        ],
                        "boost": 25,
                        "_name": "welding"
                    }
                }
            ]
        }
    },
    "aggs": {
        "category": {
            "terms": {
                "field": "category",
                "size": 200
            },
            "aggs": {
                "dates": {
                    "date_histogram": {
                        "field": "pulbicationDate",
                        "interval": "year",
                        "format": "yyyy"
                    }
                }
            }
        }
    }
}

I was expecting aggregation results where I would have all the Category Buckets and Also the date Histogram of Each Category that's matching the Query.

Thank you.

Wasn't this answered in Terms Bucket Aggregation count per Year?

Hi Mark. Yes that's the answer.
Actually my question itself is the answer. It didn't work for me when I posted the question. So, I reposted it again with some changes (the post you are referring to )

Ah ok, well it's good not to post the same thing more than once. It makes it harder to help :slight_smile: