Class FunctionDistinctValuesCollector
Function based implementation of AbstractDistinctValuesCollector.
Note
This API is experimental and might change in incompatible ways in the next release.
Inheritance
Inherited Members
Namespace: Lucene.Net.Search.Grouping.Function
Assembly: Lucene.Net.Grouping.dll
Syntax
public class FunctionDistinctValuesCollector : AbstractDistinctValuesCollector<FunctionDistinctValuesCollector.GroupCount>, IAbstractDistinctValuesCollector<FunctionDistinctValuesCollector.GroupCount>, ICollector
Constructors
FunctionDistinctValuesCollector(IDictionary, ValueSource, ValueSource, IEnumerable<ISearchGroup<MutableValue>>)
Function based implementation of AbstractDistinctValuesCollector.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public FunctionDistinctValuesCollector(IDictionary vsContext, ValueSource groupSource, ValueSource countSource, IEnumerable<ISearchGroup<MutableValue>> groups)
Parameters
Type | Name | Description |
---|---|---|
IDictionary | vsContext | |
ValueSource | groupSource | |
ValueSource | countSource | |
IEnumerable<ISearchGroup<MutableValue>> | groups |
Properties
Groups
Returns all unique values for each top N group.
Declaration
public override IEnumerable<FunctionDistinctValuesCollector.GroupCount> Groups { get; }
Property Value
Type | Description |
---|---|
IEnumerable<FunctionDistinctValuesCollector.GroupCount> | all unique values for each top N group |
Overrides
Methods
Collect(int)
Called once for every document matching a query, with the unbased document number.
Note: The collection of the current segment can be terminated by throwing a Lucene.Net.Search.CollectionTerminatedException. In this case, the last docs of the current Lucene.Net.Index.AtomicReaderContext will be skipped and Lucene.Net.Search.IndexSearcher will swallow the exception and continue collection with the next leaf. Note: this is called in an inner search loop. For good search performance, implementations of this method should not call Doc(int) or Document(int) on every hit. Doing so can slow searches by an order of magnitude or more.Declaration
public override void Collect(int doc)
Parameters
Type | Name | Description |
---|---|---|
int | doc |
Overrides
SetNextReader(AtomicReaderContext)
Called before collecting from each Lucene.Net.Index.AtomicReaderContext. All doc ids in Collect(int) will correspond to Lucene.Net.Index.IndexReaderContext.Reader.
Add Lucene.Net.Index.AtomicReaderContext.DocBase to the current Lucene.Net.Index.IndexReaderContext.Reader's internal document id to re-base ids in Collect(int).
Declaration
public override void SetNextReader(AtomicReaderContext context)
Parameters
Type | Name | Description |
---|---|---|
AtomicReaderContext | context | next atomic reader context |