OpenSearch/core
Martijn van Groningen a056c5d469
aggs: Changed how top_hits initialises leaf collectors
Both TopDocsCollector and LeafCollector were being kept around at the aggregator level. In case the nested aggregator would do a post collection then this could cause pushing down docids to top hits child aggregators that already moved the next LeafCollector (causing assertions to trip and incorrect results).

By keeping track of the LeafCollector in a seperate map at the leaf bucket level this problem can simply not happen any more as the place holding LeafCollector is no longer shared.

Also LeafCollector instances for TopDocsCollectors are no longer pre-created as the beginning a new segment is evaluated. There is no guarantee that TopHitsAggregator encounters a document for a particular bucket and there has to be logic to create LeafCollector instances which have not been seen before.

Closes #26738
2017-09-22 15:59:43 +02:00
..
licenses Upgrade to Lucene 7.0.0 2017-09-21 19:19:33 -04:00
src aggs: Changed how top_hits initialises leaf collectors 2017-09-22 15:59:43 +02:00
build.gradle Upgrade to Log4j 2.9.0 2017-08-31 09:54:35 -04:00