Group Query with Top hits - Scope for Performance improvement


(Pradeep) #1

Hi,

I have written the following group query which groups and sorts based on Top-hits. But this seems to be lower performance compared to SOLRCloud. Is there any scope for improvising the same..? advice

{
"size" : 0,
"query" : {
"bool" : {
"must" : {
"match" : { "bookType" : "Horror" }
},
"must" : {
"match" : { "sections" : "5" }
},
"must" : {
"range" : {
"publishedDate" : {
"gte": "now+6h"
}
}
}
}
},
"aggs": {
"grp_by_published_date": {
"terms": {
"field": "publishedDate"
},
"aggs": {
"grp_by_published_date_hits": {
"top_hits": {
"sort": [
{
"publishedDate": {
"order": "asc"
}
}
],
"_source": {
"include": [
"author","pages","publisedDate","reviewLink"
]
},
"size" : 1
}
}
}
}
}
}

Thanks,
Pradeep


(system) #2