public class FacetIndexingParams extends Object
NOTE: This class is also used during faceted search in order to e.g. know which field holds the drill-down terms or the fulltree posting. Therefore this class should be initialized once and you should refrain from changing it. Also note that if you make any changes to it (e.g. suddenly deciding that drill-down terms should be read from a different field) and use it on an existing index, things may not work as expected.
Modifier and Type | Field and Description |
---|---|
static FacetIndexingParams |
ALL_PARENTS
|
protected CategoryListParams |
clParams |
protected static CategoryListParams |
DEFAULT_CATEGORY_LIST_PARAMS |
static char |
DEFAULT_FACET_DELIM_CHAR
The default delimiter with which
CategoryPath.components are
concatenated when written to the index, e.g. |
Constructor and Description |
---|
FacetIndexingParams()
Initializes new default params.
|
FacetIndexingParams(CategoryListParams categoryListParams)
Initializes new params with the given
CategoryListParams . |
Modifier and Type | Method and Description |
---|---|
int |
drillDownTermText(CategoryPath path,
char[] buffer)
Copies the text required to execute a drill-down query on the given
category to the given
char[] , and returns the number of characters
that were written. |
boolean |
equals(Object obj) |
List<CategoryListParams> |
getAllCategoryListParams()
Returns a list of all
categoryListParams that
are used for facets indexing. |
CategoryListParams |
getCategoryListParams(CategoryPath category)
Returns the
CategoryListParams for this CategoryPath . |
char |
getFacetDelimChar()
Returns the delimiter character used internally for concatenating category
path components, e.g.
|
OrdinalPolicy |
getOrdinalPolicy()
Returns the
OrdinalPolicy that is used during indexing. |
int |
getPartitionSize()
Returns the size of a partition.
|
PathPolicy |
getPathPolicy()
Returns the
PathPolicy that is used during indexing. |
int |
hashCode() |
protected static final CategoryListParams DEFAULT_CATEGORY_LIST_PARAMS
public static final FacetIndexingParams ALL_PARENTS
FacetIndexingParams
which fixes OrdinalPolicy
to
OrdinalPolicy.NO_PARENTS
. This is a singleton equivalent to new
FacetIndexingParams()
.public static final char DEFAULT_FACET_DELIM_CHAR
CategoryPath.components
are
concatenated when written to the index, e.g. as drill-down terms. If you
choose to override it by overiding getFacetDelimChar()
, you should
make sure that you return a character that's not found in any path
component.protected final CategoryListParams clParams
public FacetIndexingParams()
ALL_PARENTS
to save unnecessary object allocations.public FacetIndexingParams(CategoryListParams categoryListParams)
CategoryListParams
.public CategoryListParams getCategoryListParams(CategoryPath category)
CategoryListParams
for this CategoryPath
. The
default implementation returns the same CategoryListParams
for all
categories (even if category
is null
).PerDimensionIndexingParams
public int drillDownTermText(CategoryPath path, char[] buffer)
char[]
, and returns the number of characters
that were written.
NOTE: You should make sure that the char[]
is large enough,
by e.g. calling CategoryPath.fullPathLength()
.
public int getPartitionSize()
partitionSize=100K
would mean that if your taxonomy index contains 420K categories, they will
be divided into 5 groups and at search time a FacetArrays
will be
allocated at the size of the partition.
This is real advanced setting and should be changed with care. By default, all categories are put in one partition. You should modify this setting if you have really large taxonomies (e.g. 1M+ nodes).
public List<CategoryListParams> getAllCategoryListParams()
categoryListParams
that
are used for facets indexing.public OrdinalPolicy getOrdinalPolicy()
OrdinalPolicy
that is used during indexing. By default
returns OrdinalPolicy.ALL_PARENTS
which means that the full
hierarchy will be stored for every document.public PathPolicy getPathPolicy()
PathPolicy
that is used during indexing. By default
returns PathPolicy.ALL_CATEGORIES
which means that the full
hierarchy is added as drill-down terms for every document.public char getFacetDelimChar()
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.