Package org.apache.lucene.facet.taxonomy
Class IntTaxonomyFacets
- java.lang.Object
-
- org.apache.lucene.facet.Facets
-
- org.apache.lucene.facet.taxonomy.TaxonomyFacets
-
- org.apache.lucene.facet.taxonomy.IntTaxonomyFacets
-
- Direct Known Subclasses:
FastTaxonomyFacetCounts,TaxonomyFacetCounts,TaxonomyFacetSumIntAssociations
public abstract class IntTaxonomyFacets extends TaxonomyFacets
Base class for all taxonomy-based facets that aggregate to a per-ords int[].
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.facet.taxonomy.TaxonomyFacets
config, indexFieldName, parents, taxoReader
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedIntTaxonomyFacets(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config, FacetsCollector fc)Sole constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NumbergetSpecificValue(String dim, String... path)Return the count or value for a specific path.FacetResultgetTopChildren(int topN, String dim, String... path)Returns the topN child labels under the specified path.protected voidincrement(int ordinal)Increment the count for this ordinal by 1.protected voidincrement(int ordinal, int amount)Increment the count for this ordinal byamount..protected voidrollup()Rolls up any single-valued hierarchical dimensions.protected booleanuseHashTable(FacetsCollector fc, TaxonomyReader taxoReader)Return true if a sparse hash table should be used for counting, instead of a dense int[].-
Methods inherited from class org.apache.lucene.facet.taxonomy.TaxonomyFacets
childrenLoaded, getAllDims, getChildren, getSiblings, siblingsLoaded, verifyDim
-
-
-
-
Constructor Detail
-
IntTaxonomyFacets
protected IntTaxonomyFacets(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config, FacetsCollector fc) throws IOException
Sole constructor.- Throws:
IOException
-
-
Method Detail
-
useHashTable
protected boolean useHashTable(FacetsCollector fc, TaxonomyReader taxoReader)
Return true if a sparse hash table should be used for counting, instead of a dense int[].
-
increment
protected void increment(int ordinal)
Increment the count for this ordinal by 1.
-
increment
protected void increment(int ordinal, int amount)Increment the count for this ordinal byamount..
-
rollup
protected void rollup() throws IOExceptionRolls up any single-valued hierarchical dimensions.- Throws:
IOException
-
getSpecificValue
public Number getSpecificValue(String dim, String... path) throws IOException
Description copied from class:FacetsReturn the count or value for a specific path. Returns -1 if this path doesn't exist, else the count.- Specified by:
getSpecificValuein classFacets- Throws:
IOException
-
getTopChildren
public FacetResult getTopChildren(int topN, String dim, String... path) throws IOException
Description copied from class:FacetsReturns the topN child labels under the specified path. Returns null if the specified path doesn't exist or if this dimension was never seen.- Specified by:
getTopChildrenin classFacets- Throws:
IOException
-
-