Class MultiBucketCollector
- java.lang.Object
-
- org.elasticsearch.search.aggregations.BucketCollector
-
- org.elasticsearch.search.aggregations.MultiBucketCollector
-
- All Implemented Interfaces:
Collector
public class MultiBucketCollector extends BucketCollector
ABucketCollectorwhich allows running a bucket collection with severalBucketCollectors. It is similar to theMultiCollectorexcept that thewrap(org.elasticsearch.search.aggregations.BucketCollector...)method filters out theBucketCollector.NO_OP_COLLECTORs and not the null ones.
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.search.aggregations.BucketCollector
NO_OP_COLLECTOR
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LeafBucketCollectorgetLeafCollector(LeafReaderContext context)Create a newcollectorto collect the given context.voidpostCollection()Post-collection callback.voidpreCollection()Pre collection callback.ScoreModescoreMode()Indicates what features are required from the scorer.StringtoString()static BucketCollectorwrap(Iterable<? extends BucketCollector> collectors)Wraps a list ofBucketCollectors with aMultiBucketCollector.static BucketCollectorwrap(BucketCollector... collectors)Seewrap(Iterable).
-
-
-
Method Detail
-
wrap
public static BucketCollector wrap(BucketCollector... collectors)
Seewrap(Iterable).
-
wrap
public static BucketCollector wrap(Iterable<? extends BucketCollector> collectors)
Wraps a list ofBucketCollectors with aMultiBucketCollector. This method works as follows:- Filters out the
BucketCollector.NO_OP_COLLECTORs collectors, so they are not used during search time. - If the input contains 1 real collector, it is returned.
- Otherwise the method returns a
MultiBucketCollectorwhich wraps the non-BucketCollector.NO_OP_COLLECTORcollectors.
- Filters out the
-
scoreMode
public ScoreMode scoreMode()
Description copied from interface:CollectorIndicates what features are required from the scorer.
-
preCollection
public void preCollection() throws IOExceptionDescription copied from class:BucketCollectorPre collection callback.- Specified by:
preCollectionin classBucketCollector- Throws:
IOException
-
postCollection
public void postCollection() throws IOExceptionDescription copied from class:BucketCollectorPost-collection callback.- Specified by:
postCollectionin classBucketCollector- Throws:
IOException
-
getLeafCollector
public LeafBucketCollector getLeafCollector(LeafReaderContext context) throws IOException
Description copied from interface:CollectorCreate a newcollectorto collect the given context.- Specified by:
getLeafCollectorin interfaceCollector- Specified by:
getLeafCollectorin classBucketCollector- Parameters:
context- next atomic reader context- Throws:
IOException
-
-