Hi experts
I have my query
{
"query": {"term": { "content_level": "A" }},
"aggs": {
"author": {
"terms": {"field": "author_name",
"order": { "count.value" : "desc" },
"size" : 10},
"aggs": {
"count": {
"cardinality": {"field": "news_id"}
}
}
}
}
}
The buckets result seem ok but my problem is if the Author dont have content_level A, i cant show this author. So i want to update my query with sort by content_level desc then do the cardinality aggresstion. How can i do it. I have try many ways but my buckets still get wrong result.
Thanks