I need to do an aggregation + sorting + pagination in one of the indexes.
I learned about internal functionality of Elastic search,
I have 5 total shards, it will sort the individual shards and fetch the result, by default each shard will return in 10 records. Then the 50 records are sorted again and it will fetch the top 10 record since by default size is 10.
ouput:
The aggregated results are returned in separate field named as "aggregations".In order to do pagination in this aggregated data,size and from are not working.
So tired of doing termBuilder.size(500), now the logic was differs as per this link (http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html)
It leads to inaccuracy of data.
Can any one suggest me how to deal with aggregation + pagination.