- All Known Subinterfaces:
GenericTermsCollector
- All Known Implementing Classes:
AllGroupHeadsCollector
,AllGroupHeadsCollector.ScoringGroupHeadsCollector
,AllGroupHeadsCollector.SortingGroupHeadsCollector
,AllGroupsCollector
,BlockGroupingCollector
,CachingCollector
,CachingCollector.NoScoreCachingCollector
,CachingCollector.ScoreCachingCollector
,CollectingMatcher.MatchCollector
,DistinctValuesCollector
,DistinctValuesCollector.ValuesCollector
,DiversifiedTopDocsCollector
,DocValuesStatsCollector
,DocValuesTermsCollector
,FacetFieldCollector
,FacetsCollector
,FacetsCollectorManager.ReducedFacetsCollector
,FilterCollector
,FirstPassGroupingCollector
,GlobalOrdinalsCollector
,GlobalOrdinalsWithScoreCollector
,GlobalOrdinalsWithScoreCollector.Avg
,GlobalOrdinalsWithScoreCollector.Max
,GlobalOrdinalsWithScoreCollector.Min
,GlobalOrdinalsWithScoreCollector.NoScore
,GlobalOrdinalsWithScoreCollector.Sum
,GroupFacetCollector
,LargeNumHitsTopDocsCollector
,MemoryAccountingBitsetCollector
,MultiCollector
,PositiveScoresOnlyCollector
,ProfilerCollector
,ProfilerCollectorWrapper
,RandomSamplingFacetsCollector
,RandomSamplingFacetsCollector.ReducedRandomSamplingFacetsCollector
,ReadonlyQueryIndex.LazyMonitorQueryCollector
,SecondPassGroupingCollector
,SimpleCollector
,TermGroupFacetCollector
,TermGroupFacetCollector.MV
,TermGroupFacetCollector.SV
,TermsCollector
,TermsCollector.MV
,TermsCollector.SV
,TermsWithScoreCollector
,TermsWithScoreCollector.MV
,TermsWithScoreCollector.MV.Avg
,TermsWithScoreCollector.SV
,TermsWithScoreCollector.SV.Avg
,TopDocsCollector
,TopFieldCollector
,TopFieldCollector.PagingFieldCollector
,TopFieldCollector.SimpleFieldCollector
,TopGroupsCollector
,TopGroupsCollector.MaxScoreCollector
,TopGroupsCollector.TopDocsAndMaxScoreCollector
,TopScoreDocCollector
,TopSuggestDocsCollector
,TotalHitCountCollector
,TotalHitCountCollectorManager.LeafPartitionAwareTotalHitCountCollector
,WritableQueryIndex.MonitorQueryCollector
public interface Collector
Expert: Collectors are primarily meant to be used to gather raw results from a search, and
implement sorting or custom result filtering, collation, etc.
Lucene's core collectors are derived from Collector
and SimpleCollector
.
Likely your application can use one of these classes, or subclass TopDocsCollector
,
instead of implementing Collector directly:
TopDocsCollector
is an abstract base class that assumes you will retrieve the top N docs, according to some criteria, after collection is done.TopScoreDocCollector
is a concrete subclassTopDocsCollector
and sorts according to score + docID. This is used internally by theIndexSearcher
search methods that do not take an explicitSort
. It is likely the most frequently used collector.TopFieldCollector
subclassesTopDocsCollector
and sorts according to a specifiedSort
object (sort by field). This is used internally by theIndexSearcher
search methods that take an explicitSort
.PositiveScoresOnlyCollector
wraps any other Collector and prevents collection of hits whose score is <= 0.0
-
Method Summary
Modifier and TypeMethodDescriptiongetLeafCollector
(LeafReaderContext context) Create a newcollector
to collect the given context.Indicates what features are required from the scorer.default void
Set theWeight
that will be used to produce scorers that will feedLeafCollector
s.
-
Method Details
-
getLeafCollector
Create a newcollector
to collect the given context.- Parameters:
context
- next atomic reader context- Throws:
IOException
-
scoreMode
ScoreMode scoreMode()Indicates what features are required from the scorer. -
setWeight
Set theWeight
that will be used to produce scorers that will feedLeafCollector
s. This is typically useful to have access toWeight.count(org.apache.lucene.index.LeafReaderContext)
fromgetLeafCollector(org.apache.lucene.index.LeafReaderContext)
.
-