public interface OrdinalPolicy extends Serializable
ALL_PARENTS
policy always
adds all parents, where NO_PARENTS
never adds any parents.Modifier and Type | Field and Description |
---|---|
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. |
Modifier and Type | Method and Description |
---|---|
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.
|
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
.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.Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.