public class CategoryListParams
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static Term |
DEFAULT_TERM
The default term used to store the facets information.
|
Constructor and Description |
---|
CategoryListParams()
Constructs a default category list parameters object, using
DEFAULT_TERM . |
CategoryListParams(Term term)
Constructs a category list parameters object, using the given
Term . |
Modifier and Type | Method and Description |
---|---|
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(java.lang.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. |
public static final Term DEFAULT_TERM
public CategoryListParams()
DEFAULT_TERM
.public IntEncoder createEncoder()
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:
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
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).hashCode
in class java.lang.Object
public CategoryListIterator createCategoryListIterator(IndexReader reader, int partition) throws java.io.IOException
java.io.IOException
Copyright © 2000-2023 Apache Software Foundation. All Rights Reserved.