|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OrdinalPolicy
A policy for adding category parent ordinals to the list of ordinals that are
encoded for a given document. The default ALL_PARENTS
policy always
adds all parents, where NO_PARENTS
never adds any parents.
Field Summary | |
---|---|
static OrdinalPolicy |
ALL_PARENTS
An OrdinalPolicy which stores all parent ordinals, except
TaxonomyReader.ROOT_ORDINAL . |
static OrdinalPolicy |
NO_PARENTS
An OrdinalPolicy which never stores parent ordinals. |
Method Summary | |
---|---|
void |
init(TaxonomyWriter taxonomyWriter)
Initialize the policy with a TaxonomyWriter. |
boolean |
shouldAdd(int ordinal)
Check whether a given category ordinal should be added to the stream. |
Field Detail |
---|
static final OrdinalPolicy NO_PARENTS
OrdinalPolicy
which never stores parent ordinals. Useful if you
only want to store the exact categories that were added to the document.
Note that this is a rather expert policy, which requires a matching
FacetsAccumulator
that computes the weight of the parent categories
on-the-fly.
static final OrdinalPolicy ALL_PARENTS
OrdinalPolicy
which stores all parent ordinals, except
TaxonomyReader.ROOT_ORDINAL
. This is the default
OrdinalPolicy
and works with the default FacetsAccumulator
.
Method Detail |
---|
boolean shouldAdd(int ordinal)
ordinal
- A given category ordinal which is to be tested for stream
addition.
true
if the category should be added.
false
otherwise.void init(TaxonomyWriter taxonomyWriter)
taxonomyWriter
- A relevant taxonomyWriter object, with which ordinals sent to
shouldAdd(int)
are examined.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |