public class MultiCollector extends java.lang.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 | Class and Description |
|---|---|
private static class |
MultiCollector.MultiLeafCollector |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
cacheScores |
private Collector[] |
collectors |
| Modifier | Constructor and Description |
|---|---|
private |
MultiCollector(Collector... collectors) |
| Modifier and Type | Method and Description |
|---|---|
LeafCollector |
getLeafCollector(LeafReaderContext context)
Create a new
collector to collect the given context. |
ScoreMode |
scoreMode()
Indicates what features are required from the scorer.
|
static Collector |
wrap(Collector... collectors)
See
wrap(Iterable). |
static Collector |
wrap(java.lang.Iterable<? extends Collector> collectors)
Wraps a list of
Collectors with a MultiCollector. |
private final boolean cacheScores
private final Collector[] collectors
private MultiCollector(Collector... collectors)
public static Collector wrap(Collector... collectors)
wrap(Iterable).public static Collector wrap(java.lang.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.
java.lang.IllegalArgumentException - if either 0 collectors were input, or all collectors are
null.public ScoreMode scoreMode()
Collectorpublic LeafCollector getLeafCollector(LeafReaderContext context) throws java.io.IOException
Collectorcollector to collect the given context.getLeafCollector in interface Collectorcontext - next atomic reader contextjava.io.IOException