Class MultiBucketCollector
java.lang.Object
org.elasticsearch.search.aggregations.BucketCollector
org.elasticsearch.search.aggregations.MultiBucketCollector
- All Implemented Interfaces:
org.apache.lucene.search.Collector
public class MultiBucketCollector extends BucketCollector
A
BucketCollector which allows running a bucket collection with several
BucketCollectors. It is similar to the MultiCollector except that the
wrap(org.elasticsearch.search.aggregations.BucketCollector...) method filters out the BucketCollector.NO_OP_COLLECTORs and not
the null ones.-
Field Summary
-
Method Summary
Modifier and Type Method Description LeafBucketCollectorgetLeafCollector(org.apache.lucene.index.LeafReaderContext context)voidpostCollection()Post-collection callback.voidpreCollection()Pre collection callback.org.apache.lucene.search.ScoreModescoreMode()java.lang.StringtoString()static BucketCollectorwrap(java.lang.Iterable<? extends BucketCollector> collectors)Wraps a list ofBucketCollectors with aMultiBucketCollector.static BucketCollectorwrap(BucketCollector... collectors)Seewrap(Iterable).
-
Method Details
-
wrap
Seewrap(Iterable). -
wrap
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 org.apache.lucene.search.ScoreMode scoreMode() -
preCollection
public void preCollection() throws java.io.IOExceptionDescription copied from class:BucketCollectorPre collection callback.- Specified by:
preCollectionin classBucketCollector- Throws:
java.io.IOException
-
postCollection
public void postCollection() throws java.io.IOExceptionDescription copied from class:BucketCollectorPost-collection callback.- Specified by:
postCollectionin classBucketCollector- Throws:
java.io.IOException
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
getLeafCollector
public LeafBucketCollector getLeafCollector(org.apache.lucene.index.LeafReaderContext context) throws java.io.IOException- Specified by:
getLeafCollectorin interfaceorg.apache.lucene.search.Collector- Specified by:
getLeafCollectorin classBucketCollector- Throws:
java.io.IOException
-