Package org.apache.lucene.search
Class MultiCollector
java.lang.Object
org.apache.lucene.search.MultiCollector
- All Implemented Interfaces:
Collector
A
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classprivate static class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetLeafCollector(LeafReaderContext context) Create a newcollectorto collect the given context.Indicates what features are required from the scorer.static CollectorWraps a list ofCollectors with aMultiCollector.static CollectorSeewrap(Iterable).
-
Field Details
-
cacheScores
private final boolean cacheScores -
collectors
-
-
Constructor Details
-
MultiCollector
-
-
Method Details
-
wrap
Seewrap(Iterable). -
wrap
Wraps a list ofCollectors with aMultiCollector. This method works as follows:- Filters out the
nullcollectors, so they are not used during search time. - If the input contains 1 real collector (i.e. non-
null), it is returned. - Otherwise the method returns a
MultiCollectorwhich wraps the non-nullones.
- Throws:
IllegalArgumentException- if either 0 collectors were input, or all collectors arenull.
- Filters out the
-
scoreMode
Description copied from interface:CollectorIndicates what features are required from the scorer. -
getLeafCollector
Description copied from interface:CollectorCreate a newcollectorto collect the given context.- Specified by:
getLeafCollectorin interfaceCollector- Parameters:
context- next atomic reader context- Throws:
IOException
-