Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

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

All Implemented Interfaces:
  Serializable

    public class CategoryListParams

extends Object
implements Serializable

Contains parameters for a category list *

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

Field Summary
`static Term` | `DEFAULT_TERM` The default term used to store the facets information.

Constructor Summary
`CategoryListParams()` Constructs a default category list parameters object, using `DEFAULT_TERM`.
`CategoryListParams(Term term)` Constructs a category list parameters object, using the given `Term`.

Method Summary
`CategoryListIterator` | `createCategoryListIterator(IndexReader reader, int partition)` Create the category list iterator for the specified partition.
`IntEncoder` | `createEncoder()` Allows to override how categories are encoded and decoded.
`boolean` | `equals(Object o)` Equality is defined by the 'term' that defines this category list.
`Term` | `getTerm()` A `Term` who's payload holds the category-list.
`int` | `hashCode()` Hashcode is similar to `equals(Object)`, in that it uses the term that defines this category list to derive the hashcode.

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

Field Detail

### DEFAULT_TERM

    public static final Term DEFAULT_TERM

  The default term used to store the facets information.

Constructor Detail

### CategoryListParams

    public CategoryListParams()

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

### CategoryListParams

    public CategoryListParams(Term term)

  Constructs a category list parameters object, using the given `Term`.

  Parameters:
    `term` - who's payload hold the category-list.

Method Detail

### getTerm

    public final Term getTerm()

  A `Term` who's payload holds the category-list.

### 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)

  Equality is defined by the 'term' that defines this category list. Sub-classes should override this method if a more complex calculation is needed to ensure equality.

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Hashcode is similar to `equals(Object)`, in that it uses the term that defines this category list to derive the hashcode. Subclasses need to ensure that equality/hashcode is correctly defined, or there could be side-effects in the `TotalFacetCounts` caching mechanism (as the filename for a Total Facet Counts array cache is dependent on the hashCode, so it should consistently return the same hash for identity).

  Overrides:
    `hashCode` in class `Object`

### createCategoryListIterator

    public CategoryListIterator createCategoryListIterator(IndexReader reader,
                                                           int partition)
                                                    throws IOException

  Create the category list iterator for the specified partition.

  Throws:
    `IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD