Class AbstractAllGroupHeadsCollector<GH>
This collector specializes in collecting the most relevant document (group head) for each group that match the query.
Note
This API is experimental and might change in incompatible ways in the next release.
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Search.Grouping
Assembly: Lucene.Net.Grouping.dll
Syntax
public abstract class AbstractAllGroupHeadsCollector<GH> : AbstractAllGroupHeadsCollector, ICollector where GH : AbstractAllGroupHeadsCollector_GroupHead
Type Parameters
Name | Description |
---|---|
GH |
Constructors
AbstractAllGroupHeadsCollector(int)
This collector specializes in collecting the most relevant document (group head) for each group that match the query.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
protected AbstractAllGroupHeadsCollector(int numberOfSorts)
Parameters
Type | Name | Description |
---|---|---|
int | numberOfSorts |
Fields
m_compIDXEnd
This collector specializes in collecting the most relevant document (group head) for each group that match the query.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
protected readonly int m_compIDXEnd
Field Value
Type | Description |
---|---|
int |
m_reversed
This collector specializes in collecting the most relevant document (group head) for each group that match the query.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
protected readonly int[] m_reversed
Field Value
Type | Description |
---|---|
int[] |
m_temporalResult
This collector specializes in collecting the most relevant document (group head) for each group that match the query.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
protected readonly AbstractAllGroupHeadsCollector<GH>.TemporalResult m_temporalResult
Field Value
Type | Description |
---|---|
AbstractAllGroupHeadsCollector<GH>.TemporalResult |
Properties
AcceptsDocsOutOfOrder
Return true
if this collector does not
require the matching docIDs to be delivered in int sort
order (smallest to largest) to Collect(int).
Most Lucene Query implementations will visit matching docIDs in order. However, some queries (currently limited to certain cases of Lucene.Net.Search.BooleanQuery) can achieve faster searching if the Lucene.Net.Search.ICollector allows them to deliver the docIDs out of order.
Many collectors don't mind getting docIDs out of
order, so it's important to return true
here.
Declaration
public override bool AcceptsDocsOutOfOrder { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
CollectedGroupHeads
Returns the collected group heads. Subsequent calls should return the same group heads.
Declaration
protected abstract ICollection<GH> CollectedGroupHeads { get; }
Property Value
Type | Description |
---|---|
ICollection<GH> | the collected group heads |
GroupHeadsCount
The number of group heads found for a query. LUCENENET NOTE: This was groupHeadsSize() in Lucene
Declaration
public override int GroupHeadsCount { get; }
Property Value
Type | Description |
---|---|
int | the number of group heads found for a query. |
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
RetrieveGroupHeadAndAddIfNotExist(int)
Returns the group head and puts it into AbstractAllGroupHeadsCollector<GH>.TemporalResult. If the group head wasn't encountered before then it will be added to the collected group heads.
The Stop property will be true
if the group head wasn't encountered before
otherwise false
.
Declaration
protected override abstract void RetrieveGroupHeadAndAddIfNotExist(int doc)
Parameters
Type | Name | Description |
---|---|---|
int | doc | The document to retrieve the group head for. |
Overrides
Exceptions
Type | Condition |
---|---|
IOException | If I/O related errors occur |
RetrieveGroupHeads()
This collector specializes in collecting the most relevant document (group head) for each group that match the query.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public override int[] RetrieveGroupHeads()
Returns
Type | Description |
---|---|
int[] | an int array containing all group heads. The size of the array is equal to number of collected unique groups. |
Overrides
RetrieveGroupHeads(int)
This collector specializes in collecting the most relevant document (group head) for each group that match the query.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public override FixedBitSet RetrieveGroupHeads(int maxDoc)
Parameters
Type | Name | Description |
---|---|---|
int | maxDoc | The maxDoc of the top level Lucene.Net.Index.IndexReader |
Returns
Type | Description |
---|---|
FixedBitSet | a Lucene.Net.Util.FixedBitSet containing all group heads. |