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
ABucketCollector
which allows running a bucket collection with severalBucketCollector
s. It is similar to theMultiCollector
except that thewrap(org.elasticsearch.search.aggregations.BucketCollector...)
method filters out theBucketCollector.NO_OP_COLLECTOR
s and not the null ones.
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.search.aggregations.BucketCollector
NO_OP_COLLECTOR
-
-
Method Summary
Modifier and Type Method Description LeafBucketCollector
getLeafCollector(org.apache.lucene.index.LeafReaderContext context)
boolean
needsScores()
void
postCollection()
Post-collection callback.void
preCollection()
Pre collection callback.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 Detail
-
wrap
public static BucketCollector wrap(BucketCollector... collectors)
Seewrap(Iterable)
.
-
wrap
public static BucketCollector wrap(java.lang.Iterable<? extends BucketCollector> collectors)
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
-
preCollection
public void preCollection() throws java.io.IOException
Description copied from class:BucketCollector
Pre collection callback.- Specified by:
preCollection
in classBucketCollector
- Throws:
java.io.IOException
-
postCollection
public void postCollection() throws java.io.IOException
Description copied from class:BucketCollector
Post-collection callback.- Specified by:
postCollection
in classBucketCollector
- Throws:
java.io.IOException
-
needsScores
public boolean needsScores()
-
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
-
-