Class SortedSetDocValuesFacetCounts
Compute facets counts from previously indexed SortedSetDocValuesFacetField, without require a separate taxonomy index. Faceting is a bit slower (~25%), and there is added cost on every Lucene.Net.Index.IndexReader open to create a new SortedSetDocValuesReaderState. Furthermore, this does not support hierarchical facets; only flat (dimension + label) facets, but it uses quite a bit less RAM to do so.
NOTE: this class should be instantiated and then used from a single thread, because it holds a thread-private instance of Lucene.Net.Index.SortedSetDocValues.
NOTE:: tie-break is by unicode sort order
Note
This API is experimental and might change in incompatible ways in the next release.
Inherited Members
Namespace: Lucene.Net.Facet.SortedSet
Assembly: Lucene.Net.Facet.dll
Syntax
public class SortedSetDocValuesFacetCounts : Facets
Constructors
SortedSetDocValuesFacetCounts(SortedSetDocValuesReaderState, FacetsCollector)
Sparse faceting: returns any dimension that had any hits, topCount labels per dimension.
Declaration
public SortedSetDocValuesFacetCounts(SortedSetDocValuesReaderState state, FacetsCollector hits)
Parameters
Type | Name | Description |
---|---|---|
SortedSetDocValuesReaderState | state | |
FacetsCollector | hits |
Methods
GetAllDims(int)
Returns topN labels for any dimension that had hits, sorted by the number of hits that dimension matched; this is used for "sparse" faceting, where many different dimensions were indexed, for example depending on the type of document.
Declaration
public override IList<FacetResult> GetAllDims(int topN)
Parameters
Type | Name | Description |
---|---|---|
int | topN |
Returns
Type | Description |
---|---|
IList<FacetResult> |
Overrides
GetSpecificValue(string, params string[])
Return the count or value for a specific path. Returns -1 if this path doesn't exist, else the count.
Declaration
public override float GetSpecificValue(string dim, params string[] path)
Parameters
Type | Name | Description |
---|---|---|
string | dim | |
string[] | path |
Returns
Type | Description |
---|---|
float |
Overrides
GetTopChildren(int, string, params string[])
Returns the topN child labels under the specified path. Returns null if the specified path doesn't exist or if this dimension was never seen.
Declaration
public override FacetResult GetTopChildren(int topN, string dim, params string[] path)
Parameters
Type | Name | Description |
---|---|---|
int | topN | |
string | dim | |
string[] | path |
Returns
Type | Description |
---|---|
FacetResult |