Aggregations: apply 'from' if there is one shard result.
This commit is contained in:
parent
46a67b638d
commit
b8366a3213
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue