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.
@lucene.experimental
Inheritance
System.Object
FacetsConfig
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Lucene.Net.Facet.dll
Syntax
public class FacetsConfig
Constructors
|
Improve this Doc
View Source
FacetsConfig()
Declaration
Fields
|
Improve this Doc
View Source
DEFAULT_DIM_CONFIG
Default per-dimension configuration.
Declaration
public static readonly FacetsConfig.DimConfig DEFAULT_DIM_CONFIG
Field Value
|
Improve this Doc
View Source
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
Type |
Description |
System.String |
|
Properties
|
Improve this Doc
View Source
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
|
Improve this Doc
View Source
DimConfigs
Declaration
public virtual IDictionary<string, FacetsConfig.DimConfig> DimConfigs { get; }
Property Value
Methods
|
Improve this Doc
View Source
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 |
Lucene.Net.Documents.Document |
doc |
|
Returns
Type |
Description |
Lucene.Net.Documents.Document |
|
|
Improve this Doc
View Source
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
Type |
Name |
Description |
ITaxonomyWriter |
taxoWriter |
|
Lucene.Net.Documents.Document |
doc |
|
Returns
Type |
Description |
Lucene.Net.Documents.Document |
|
|
Improve this Doc
View Source
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 |
Lucene.Net.Util.Int32sRef |
ordinals |
|
Returns
Type |
Description |
Lucene.Net.Util.BytesRef |
|
|
Improve this Doc
View Source
GetDimConfig(String)
Get the current configuration for a dimension.
Declaration
public virtual FacetsConfig.DimConfig GetDimConfig(string dimName)
Parameters
Type |
Name |
Description |
System.String |
dimName |
|
Returns
|
Improve this Doc
View Source
PathToString(String, String[])
Turns a dim + path into an encoded string.
Declaration
public static string PathToString(string dim, string[] path)
Parameters
Type |
Name |
Description |
System.String |
dim |
|
System.String[] |
path |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
PathToString(String[])
Turns a dim + path into an encoded string.
Declaration
public static string PathToString(string[] path)
Parameters
Type |
Name |
Description |
System.String[] |
path |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
PathToString(String[], Int32)
Turns the first length
elements of path
into an encoded string.
Declaration
public static string PathToString(string[] path, int length)
Parameters
Type |
Name |
Description |
System.String[] |
path |
|
System.Int32 |
length |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
SetHierarchical(String, Boolean)
Pass true
if this dimension is hierarchical
(has depth > 1 paths).
Declaration
public virtual void SetHierarchical(string dimName, bool v)
Parameters
Type |
Name |
Description |
System.String |
dimName |
|
System.Boolean |
v |
|
|
Improve this Doc
View Source
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
Type |
Name |
Description |
System.String |
dimName |
|
System.String |
indexFieldName |
|
|
Improve this Doc
View Source
SetMultiValued(String, Boolean)
Pass true
if this dimension may have more than
one value per document.
Declaration
public virtual void SetMultiValued(string dimName, bool v)
Parameters
Type |
Name |
Description |
System.String |
dimName |
|
System.Boolean |
v |
|
|
Improve this Doc
View Source
SetRequireDimCount(String, Boolean)
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
Type |
Name |
Description |
System.String |
dimName |
|
System.Boolean |
v |
|
|
Improve this Doc
View Source
StringToPath(String)
Declaration
public static string[] StringToPath(string s)
Parameters
Type |
Name |
Description |
System.String |
s |
|
Returns
Type |
Description |
System.String[] |
|