Search performance on elasticsearch

Hi Team,

I have a requirement where in a search query results around 10 lacks of documents of elasticsearch.
This search query is based on the aggreation.
To get count of each bucket, I have iterated the buckets in the aggregation, get count of each bucket.

However since there are lacks of records and many buckets, iterating over the aggregating data is taking lot of time, giving performance issue.

is there any way that I can get record count bucket with out iterating the aggregation.

And also is there any limit on the result of search query to get better performance.

Below is my code:

SearchResponse response =client.prepareSearch(Constants.GENSUITE_PART_FACET_INDEX).setTypes(Constants.ITEM_FACET_MAP_TYPE)
.setQuery(QueryBuilders.boolQuery().must(QueryBuilders.matchQuery("facetId", facetId))
.must(QueryBuilders.boolQuery().must(QueryBuilders.matchQuery("partTypeId", partTypeId))))
* Increased Aggregation size.
* NREV-1220

for(Bucket entry : agg.getBuckets()){
String facetData = entry.getKeyAsString()+"("+entry.getDocCount()+")";

Please help me how can I resolve the performance issue.


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.