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

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

Direct Known Subclasses:
  PerDimensionOrdinalPolicy

    public class CategoryListParams

extends Object

Contains parameters for a category list *

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

Nested Class Summary
`static class` `CategoryListParams.OrdinalPolicy` Defines which category ordinals are encoded for every document.

Field Summary
`static String` `DEFAULT_FIELD` The default field used to store the facets information.
`static CategoryListParams.OrdinalPolicy` `DEFAULT_ORDINAL_POLICY` The default `CategoryListParams.OrdinalPolicy` that's used when encoding a document's category ordinals.
`String` `field`

Constructor Summary
`CategoryListParams()` Constructs a default category list parameters object, using `DEFAULT_FIELD`.
`CategoryListParams(String field)` Constructs a category list parameters object, using the given field.

Method Summary
`CategoryListIterator` `createCategoryListIterator(int partition)` Create the `CategoryListIterator` for the specified partition.
`IntEncoder` `createEncoder()` Allows to override how categories are encoded and decoded.
`boolean` `equals(Object o)`
`CategoryListParams.OrdinalPolicy` `getOrdinalPolicy(String dimension)` Returns the `CategoryListParams.OrdinalPolicy` to use for the given dimension.
`int` `hashCode()`
`String` `toString()`

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

Field Detail

### DEFAULT_FIELD

    public static final String DEFAULT_FIELD

  The default field used to store the facets information.

  See Also:
    Constant Field Values

### DEFAULT_ORDINAL_POLICY

    public static final CategoryListParams.OrdinalPolicy DEFAULT_ORDINAL_POLICY

  The default `CategoryListParams.OrdinalPolicy` that's used when encoding a document's category ordinals.

### field

    public final String field

Constructor Detail

### CategoryListParams

    public CategoryListParams()

  Constructs a default category list parameters object, using `DEFAULT_FIELD`.

### CategoryListParams

    public CategoryListParams(String field)

  Constructs a category list parameters object, using the given field.

Method Detail

### createEncoder

    public IntEncoder createEncoder()

  Allows to override how categories are encoded and decoded. A matching `IntDecoder` is provided by the `IntEncoder`.

  Default implementation creates a new Sorting(Unique(DGap)) encoder. Uniqueness in this regard means when the same category appears twice in a document, only one appearance would be encoded. This has effect on facet counting results.

  Some possible considerations when overriding may be:

  - an application "knows" that all categories are unique. So no need to pass through the unique filter.
  - Another application might wish to count multiple occurrences of the same category, or, use a faster encoding which will consume more space.
  In any event when changing this value make sure you know what you are doing, and test the results - e.g. counts, if the application is about counting facets.

### equals

    public boolean equals(Object o)

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### createCategoryListIterator

    public CategoryListIterator createCategoryListIterator(int partition)
                                                    throws IOException

  Create the `CategoryListIterator` for the specified partition.

  Throws:
    `IOException`

### getOrdinalPolicy

    public CategoryListParams.OrdinalPolicy getOrdinalPolicy(String dimension)

  Returns the `CategoryListParams.OrdinalPolicy` to use for the given dimension. This `CategoryListParams` always returns `DEFAULT_ORDINAL_POLICY` for all dimensions.

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

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