Elastic search 2.4 was used previously and now it has been upgraded to 5.6. I am using the below structure to query the result:
{
"query": {
"multi_match": {
"query": "' . $searchstringmsg . '",
"type": "most_fields",
"fields": [
"post_title",
"post_content",
"custom.cat_name",
"custom.series_name",
"custom.topic_name",
"custom.pos_format",
"custom.genre_name",
"post_author.display_name",
"post_meta.wps_subtitle",
"terms.post_tag.name"
],
"fuzziness": "1"
}
},
"aggs": {
"top-sites": {
"terms": {
"field": "custom.pos_format"
},
"aggs": {
"top_tags_hits": {
"top_hits": {}
}
}
}
}
}
Issue: I am getting an empty response of aggregations in the response. As shared like below. Please look in to it.
"aggregations": {
"top-sites": {
"buckets": ,
"sum_other_doc_count": 0,
"doc_count_error_upper_bound": 0
}
}