Maximum aggregation response limit


(Kedar Dixit) #1

hi,

Do we have any limit on fetching the aggregations limit, like search hits limit which is default set to 10000 ?

If so, We use scroll for scrolling over the response, Do we have anything similar to this ?

Many Thanks,
~Kedar


(David Pilato) #2

You have limits for terms agg (default to 10 terms).
You don’t really have limits for histograms but your heap size.

Aggregation is an ... aggregation of the data. The idea is to “count” or group by. It should not really gives huge result sets IMO.

What do you have in mind?


(Kedar Dixit) #3

Thanks David for your comment,

We have a requirement of finding maximum of one of the fields for every id that we insert.

something similar to below sql query:

select id,max(field1) 
from temp_table
group by id;

Here we are using AggregatorBuilderas to achieve this as below:

AggregationBuilders.terms("ids").field("id").
          subAggregation(AggregationBuilders.max("max").field("field1));

Is this right ?

Thanks,
~Kedar


(David Pilato) #4

I wonder if field collapsing would not be a better solution then.

Did you read that? https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-request-collapse.html

It supports pagination so that might be what you want.


(Mark Harwood) #5

See partitioning on the terms agg
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#_filtering_values_with_partitions


(system) #6

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