Class AbstractFirstPassGroupingCollector<TGroupValue>
FirstPassGroupingCollector is the first of two passes necessary to collect grouped hits. This pass gathers the top N sorted groups. Concrete subclasses define what a group is and how it is internally collected.
See org.apache.lucene.search.grouping for more details including a full code example.
Note
This API is experimental and might change in incompatible ways in the next release.
Inheritance
Inherited Members
Namespace: Lucene.Net.Search.Grouping
Assembly: Lucene.Net.Grouping.dll
Syntax
public abstract class AbstractFirstPassGroupingCollector<TGroupValue> : IAbstractFirstPassGroupingCollector<TGroupValue>, ICollectorType Parameters
| Name | Description | 
|---|---|
| TGroupValue | 
Constructors
| Improve this Doc View SourceAbstractFirstPassGroupingCollector(Sort, Int32)
Create the first pass collector.
Declaration
protected AbstractFirstPassGroupingCollector(Sort groupSort, int topNGroups)Parameters
| Type | Name | Description | 
|---|---|---|
| Lucene.Net.Search.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 Sort.RELEVANCE. | 
| System.Int32 | topNGroups | How many top groups to keep. | 
Exceptions
| Type | Condition | 
|---|---|
| System.IO.IOException | If I/O related errors occur | 
Fields
| Improve this Doc View Sourcem_orderedGroups
Declaration
protected SortedSet<CollectedSearchGroup<TGroupValue>> m_orderedGroupsField Value
| Type | Description | 
|---|---|
| J2N.Collections.Generic.SortedSet<CollectedSearchGroup<TGroupValue>> | 
Properties
| Improve this Doc View SourceAcceptsDocsOutOfOrder
Declaration
public virtual bool AcceptsDocsOutOfOrder { get; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
Methods
| Improve this Doc View SourceCollect(Int32)
Declaration
public virtual void Collect(int doc)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | doc | 
CopyDocGroupValue(TGroupValue, TGroupValue)
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 abstract TGroupValue CopyDocGroupValue(TGroupValue groupValue, TGroupValue reuse)Parameters
| Type | Name | Description | 
|---|---|---|
| TGroupValue | groupValue | The group value to copy | 
| TGroupValue | reuse | Optionally a reuse instance to prevent a new instance creation | 
Returns
| Type | Description | 
|---|---|
| TGroupValue | a copy of the specified group value | 
GetDocGroupValue(Int32)
Returns the group value for the specified doc.
Declaration
protected abstract TGroupValue GetDocGroupValue(int doc)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | doc | The specified doc | 
Returns
| Type | Description | 
|---|---|
| TGroupValue | the group value for the specified doc | 
GetTopGroups(Int32, Boolean)
Returns top groups, starting from offset. This may return null, if no groups were collected, or if the number of unique groups collected is <= offset.
Declaration
public virtual IEnumerable<ISearchGroup<TGroupValue>> GetTopGroups(int groupOffset, bool fillFields)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | groupOffset | The offset in the collected groups | 
| System.Boolean | fillFields | Whether to fill to SortValues | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerable<ISearchGroup<TGroupValue>> | top groups, starting from offset | 
SetNextReader(AtomicReaderContext)
Declaration
public virtual void SetNextReader(AtomicReaderContext context)Parameters
| Type | Name | Description | 
|---|---|---|
| Lucene.Net.Index.AtomicReaderContext | context | 
SetScorer(Scorer)
Declaration
public virtual void SetScorer(Scorer scorer)Parameters
| Type | Name | Description | 
|---|---|---|
| Lucene.Net.Search.Scorer | scorer |