Class FunctionFirstPassGroupingCollector<TMutableValue>
Concrete implementation of AbstractFirstPassGroupingCollector<TGroupValue> that groups based on Lucene.Net.Queries.Function.ValueSource instances.
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 FunctionFirstPassGroupingCollector<TMutableValue> : AbstractFirstPassGroupingCollector<TMutableValue>, IAbstractFirstPassGroupingCollector<TMutableValue>, ICollector where TMutableValue : MutableValue
Type Parameters
Name | Description |
---|---|
TMutableValue |
Constructors
FunctionFirstPassGroupingCollector(ValueSource, IDictionary, Sort, int)
Creates a first pass collector.
Declaration
public FunctionFirstPassGroupingCollector(ValueSource groupByVS, IDictionary vsContext, Sort groupSort, int topNGroups)
Parameters
Type | Name | Description |
---|---|---|
ValueSource | groupByVS | The Lucene.Net.Queries.Function.ValueSource instance to group by |
IDictionary | vsContext | The Lucene.Net.Queries.Function.ValueSource context |
Sort | groupSort | The Lucene.Net.Search.Sort used to sort the groups. The top sorted document within each group according to groupSort, determines how that group sorts against other groups. This must be non-null, ie, if you want to groupSort by relevance use Lucene.Net.Search.Sort.RELEVANCE. |
int | topNGroups | How many top groups to keep. |
Exceptions
Type | Condition |
---|---|
IOException | When I/O related errors occur |
Methods
CopyDocGroupValue(TMutableValue, TMutableValue)
Returns a copy of the specified group value by creating a new instance and copying the value from the specified groupValue in the new instance. Or optionally the reuse argument can be used to copy the group value in.
Declaration
protected override TMutableValue CopyDocGroupValue(TMutableValue groupValue, TMutableValue reuse)
Parameters
Type | Name | Description |
---|---|---|
TMutableValue | groupValue | The group value to copy |
TMutableValue | reuse | Optionally a reuse instance to prevent a new instance creation |
Returns
Type | Description |
---|---|
TMutableValue | a copy of the specified group value |
Overrides
GetDocGroupValue(int)
Returns the group value for the specified doc.
Declaration
protected override TMutableValue GetDocGroupValue(int doc)
Parameters
Type | Name | Description |
---|---|---|
int | doc | The specified doc |
Returns
Type | Description |
---|---|
TMutableValue | the group value for the specified 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 |