Aggregations: apply 'from' if there is one shard result.

This commit is contained in:
Martijn van Groningen 2014-05-31 13:34:49 +02:00
parent 46a67b638d
commit b8366a3213
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ public class InternalTopHits extends InternalAggregation implements TopHits, ToX
@Override @Override
public InternalAggregation reduce(ReduceContext reduceContext) { public InternalAggregation reduce(ReduceContext reduceContext) {
List<InternalAggregation> aggregations = reduceContext.aggregations(); List<InternalAggregation> aggregations = reduceContext.aggregations();
if (aggregations.size() == 1) { if (aggregations.size() == 1 && from == 0) {
return aggregations.get(0); return aggregations.get(0);
} }