public abstract class TaxonomyFacets extends Facets
| Modifier and Type | Field and Description |
|---|---|
protected FacetsConfig |
config
FacetsConfig provided to the constructor. |
protected String |
indexFieldName
Index field name provided to the constructor.
|
protected int[] |
parents
Maps an ordinal to its parent, or -1 if there is no
parent (root node).
|
protected TaxonomyReader |
taxoReader
TaxonomyReader provided to the constructor. |
| Modifier | Constructor and Description |
|---|---|
protected |
TaxonomyFacets(String indexFieldName,
TaxonomyReader taxoReader,
FacetsConfig config)
Sole constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
childrenLoaded()
Returns true if the (costly, and lazily initialized) children int[] was initialized.
|
List<FacetResult> |
getAllDims(int topN)
Returns topN labels for any dimension that had hits,
sorted by the number of hits that dimension matched;
this is used for "sparse" faceting, where many
different dimensions were indexed, for example
depending on the type of document.
|
protected int[] |
getChildren()
Returns int[] mapping each ordinal to its first child; this is a large array and
is computed (and then saved) the first time this method is invoked.
|
protected int[] |
getSiblings()
Returns int[] mapping each ordinal to its next sibling; this is a large array and
is computed (and then saved) the first time this method is invoked.
|
boolean |
siblingsLoaded()
Returns true if the (costly, and lazily initialized) sibling int[] was initialized.
|
protected FacetsConfig.DimConfig |
verifyDim(String dim)
Throws
IllegalArgumentException if the
dimension is not recognized. |
getSpecificValue, getTopChildrenprotected final String indexFieldName
protected final TaxonomyReader taxoReader
TaxonomyReader provided to the constructor.protected final FacetsConfig config
FacetsConfig provided to the constructor.protected final int[] parents
protected TaxonomyFacets(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config) throws IOException
IOExceptionprotected int[] getChildren()
throws IOException
IOExceptionprotected int[] getSiblings()
throws IOException
IOExceptionpublic boolean childrenLoaded()
public boolean siblingsLoaded()
protected FacetsConfig.DimConfig verifyDim(String dim)
IllegalArgumentException if the
dimension is not recognized. Otherwise, returns the
FacetsConfig.DimConfig for this dimension.public List<FacetResult> getAllDims(int topN) throws IOException
FacetsgetAllDims in class FacetsIOExceptionCopyright © 2000-2024 Apache Software Foundation. All Rights Reserved.