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
BucketCollector
s. It is similar to the MultiCollector
except that the
wrap(org.elasticsearch.search.aggregations.BucketCollector...)
method filters out the BucketCollector.NO_OP_COLLECTOR
s and not
the null ones.-
Field Summary
-
Method Summary
Modifier and Type Method Description LeafBucketCollector
getLeafCollector(org.apache.lucene.index.LeafReaderContext context)
void
postCollection()
Post-collection callback.void
preCollection()
Pre collection callback.org.apache.lucene.search.ScoreMode
scoreMode()
java.lang.String
toString()
static BucketCollector
wrap(java.lang.Iterable<? extends BucketCollector> collectors)
Wraps a list ofBucketCollector
s with aMultiBucketCollector
.static BucketCollector
wrap(BucketCollector... collectors)
Seewrap(Iterable)
.
-
Method Details
-
wrap
Seewrap(Iterable)
. -
wrap
Wraps a list ofBucketCollector
s with aMultiBucketCollector
. This method works as follows:- Filters out the
BucketCollector.NO_OP_COLLECTOR
s collectors, so they are not used during search time. - If the input contains 1 real collector, it is returned.
- Otherwise the method returns a
MultiBucketCollector
which wraps the non-BucketCollector.NO_OP_COLLECTOR
collectors.
- Filters out the
-
scoreMode
public org.apache.lucene.search.ScoreMode scoreMode() -
preCollection
public void preCollection() throws java.io.IOExceptionDescription copied from class:BucketCollector
Pre collection callback.- Specified by:
preCollection
in classBucketCollector
- Throws:
java.io.IOException
-
postCollection
public void postCollection() throws java.io.IOExceptionDescription copied from class:BucketCollector
Post-collection callback.- Specified by:
postCollection
in classBucketCollector
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
getLeafCollector
public LeafBucketCollector getLeafCollector(org.apache.lucene.index.LeafReaderContext context) throws java.io.IOException- Specified by:
getLeafCollector
in interfaceorg.apache.lucene.search.Collector
- Specified by:
getLeafCollector
in classBucketCollector
- Throws:
java.io.IOException
-