public class MultiCollector extends Object implements Collector
Collector which allows running a search with several
Collectors. It offers a static wrap(org.apache.lucene.search.Collector...) method which accepts a
list of collectors and wraps them with MultiCollector, while
filtering out the null null ones.| Modifier and Type | Method and Description |
|---|---|
LeafCollector |
getLeafCollector(LeafReaderContext context)
Create a new
collector to collect the given context. |
boolean |
needsScores()
Indicates if document scores are needed by this collector.
|
static Collector |
wrap(Collector... collectors)
See
wrap(Iterable). |
static Collector |
wrap(Iterable<? extends Collector> collectors)
Wraps a list of
Collectors with a MultiCollector. |
public static Collector wrap(Collector... collectors)
wrap(Iterable).public static Collector wrap(Iterable<? extends Collector> collectors)
Collectors with a MultiCollector. This
method works as follows:
null collectors, so they are not used
during search time.
null ),
it is returned.
MultiCollector which wraps the
non-null ones.
IllegalArgumentException - if either 0 collectors were input, or all collectors are
null.public boolean needsScores()
CollectorneedsScores in interface Collectortrue if scores are needed.public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException
Collectorcollector to collect the given context.getLeafCollector in interface Collectorcontext - next atomic reader contextIOExceptionCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.