Class FacetsConfig
Records per-dimension configuration. By default a
dimension is flat, single valued and does
not require count for the dimension; use
the setters in this class to change these settings for
each dim.
NOTE: this configuration is not saved into the
index, but it's vital, and up to the application to
ensure, that at search time the provided FacetsConfig
matches what was used during indexing.
Note
This API is experimental and might change in incompatible ways in the next release.
Assembly: Lucene.Net.Facet.dll
Syntax
public class FacetsConfig
Constructors
FacetsConfig()
Declaration
Fields
DEFAULT_DIM_CONFIG
Default per-dimension configuration.
Declaration
public static readonly FacetsConfig.DimConfig DEFAULT_DIM_CONFIG
Field Value
DEFAULT_INDEX_FIELD_NAME
Which Lucene field holds the drill-downs and ords (as
doc values).
Declaration
public const string DEFAULT_INDEX_FIELD_NAME = "$facets"
Field Value
Properties
DefaultDimConfig
Get the default configuration for new dimensions. Useful when
the dimension is not known beforehand and may need different
global default settings, like multivalue = true
.
Declaration
protected virtual FacetsConfig.DimConfig DefaultDimConfig { get; }
Property Value
DimConfigs
Declaration
public virtual IDictionary<string, FacetsConfig.DimConfig> DimConfigs { get; }
Property Value
Methods
Build(Document)
Translates any added FacetFields into normal fields for indexing;
only use this version if you did not add any taxonomy-based fields
(FacetField or AssociationFacetField).
NOTE: you should add the returned document to Lucene.Net.Index.IndexWriter, not the
input one!
Declaration
public virtual Document Build(Document doc)
Parameters
Type |
Name |
Description |
Document |
doc |
|
Returns
Type |
Description |
Document |
|
Build(ITaxonomyWriter, Document)
Translates any added FacetFields into normal fields for indexing.
NOTE: you should add the returned document to Lucene.Net.Index.IndexWriter, not the
input one!
Declaration
public virtual Document Build(ITaxonomyWriter taxoWriter, Document doc)
Parameters
Returns
Type |
Description |
Document |
|
DedupAndEncode(Int32sRef)
Encodes ordinals into a Lucene.Net.Util.BytesRef; expert: subclass can
override this to change encoding.
Declaration
protected virtual BytesRef DedupAndEncode(Int32sRef ordinals)
Parameters
Type |
Name |
Description |
Int32sRef |
ordinals |
|
Returns
Type |
Description |
BytesRef |
|
GetDimConfig(string)
Get the current configuration for a dimension.
Declaration
public virtual FacetsConfig.DimConfig GetDimConfig(string dimName)
Parameters
Type |
Name |
Description |
string |
dimName |
|
Returns
PathToString(string, string[])
Turns a dim + path into an encoded string.
Declaration
public static string PathToString(string dim, string[] path)
Parameters
Returns
PathToString(string[])
Turns a dim + path into an encoded string.
Declaration
public static string PathToString(string[] path)
Parameters
Type |
Name |
Description |
string[] |
path |
|
Returns
PathToString(string[], int)
Turns the first length
elements of path
into an encoded string.
Declaration
public static string PathToString(string[] path, int length)
Parameters
Type |
Name |
Description |
string[] |
path |
|
int |
length |
|
Returns
SetHierarchical(string, bool)
Pass true
if this dimension is hierarchical
(has depth > 1 paths).
Declaration
public virtual void SetHierarchical(string dimName, bool v)
Parameters
SetIndexFieldName(string, string)
Specify which index field name should hold the
ordinals for this dimension; this is only used by the
taxonomy based facet methods.
Declaration
public virtual void SetIndexFieldName(string dimName, string indexFieldName)
Parameters
SetMultiValued(string, bool)
Pass true
if this dimension may have more than
one value per document.
Declaration
public virtual void SetMultiValued(string dimName, bool v)
Parameters
SetRequireDimCount(string, bool)
Pass true
if at search time you require
accurate counts of the dimension, i.e. how many
hits have this dimension.
Declaration
public virtual void SetRequireDimCount(string dimName, bool v)
Parameters
StringToPath(string)
Declaration
public static string[] StringToPath(string s)
Parameters
Type |
Name |
Description |
string |
s |
|
Returns