## org.apache.lucene.facet.params
Class FacetIndexingParams

    java.lang.Object
      org.apache.lucene.facet.params.FacetIndexingParams

Direct Known Subclasses:
  PerDimensionIndexingParams

    public class FacetIndexingParams

extends Object

Defines parameters that are needed for facets indexing. Note that this class does not have any setters. That's because overriding the default parameters is considered expert. If you wish to override them, simply extend this class and override the relevant getter.

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.

WARNING: This API is experimental and might change in incompatible ways in the next release.

Field Summary
`protected CategoryListParams` `clParams`
`static FacetIndexingParams` `DEFAULT` A `FacetIndexingParams` which fixes a single `CategoryListParams` with `CategoryListParams.DEFAULT_ORDINAL_POLICY`.
`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 Summary
`FacetIndexingParams()` Initializes new default params.
`FacetIndexingParams(CategoryListParams categoryListParams)` Initializes new params with the given `CategoryListParams`.

Method Summary
`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.
`int` `getPartitionSize()` Returns the size of a partition.
`int` `hashCode()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_CATEGORY_LIST_PARAMS

    protected static final CategoryListParams DEFAULT_CATEGORY_LIST_PARAMS

### DEFAULT

    public static final FacetIndexingParams DEFAULT

  A `FacetIndexingParams` which fixes a single `CategoryListParams` with `CategoryListParams.DEFAULT_ORDINAL_POLICY`.

### DEFAULT_FACET_DELIM_CHAR

    public static final char DEFAULT_FACET_DELIM_CHAR

  The default delimiter with which `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.

  See Also:
    Constant Field Values

### clParams

    protected final CategoryListParams clParams

Constructor Detail

### FacetIndexingParams

    public FacetIndexingParams()

  Initializes new default params. You should use this constructor only if you intend to override any of the getters, otherwise you can use `DEFAULT` to save unnecessary object allocations.

### FacetIndexingParams

    public FacetIndexingParams(CategoryListParams categoryListParams)

  Initializes new params with the given `CategoryListParams`.

Method Detail

### getCategoryListParams

    public CategoryListParams getCategoryListParams(CategoryPath category)

  Returns the `CategoryListParams` for this `CategoryPath`. The default implementation returns the same `CategoryListParams` for all categories (even if `category` is `null`).

  See Also:
    `PerDimensionIndexingParams`

### drillDownTermText

    public 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.

  NOTE: You should make sure that the `char[]` is large enough, by e.g. calling `CategoryPath.fullPathLength()`.

### getPartitionSize

    public int getPartitionSize()

  Returns the size of a partition. Partitions allow you to divide (hence, partition) the categories space into small sets to e.g. improve RAM consumption during faceted search. For instance, `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).

### getAllCategoryListParams

    public List<CategoryListParams> getAllCategoryListParams()

  Returns a list of all `categoryListParams` that are used for facets indexing.

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### equals

    public boolean equals(Object obj)

  Overrides:
    `equals` in class `Object`

### getFacetDelimChar

    public char getFacetDelimChar()

  Returns the delimiter character used internally for concatenating category path components, e.g. for drill-down terms.

Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.