java.lang.Object
org.apache.lucene.facet.Facets
org.apache.lucene.facet.taxonomy.TaxonomyFacets
org.apache.lucene.facet.taxonomy.IntTaxonomyFacets
- Direct Known Subclasses:
TaxonomyFacetIntAssociations
Base class for all taxonomy-based facets that aggregate to int.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.lucene.facet.taxonomy.TaxonomyFacets
TaxonomyFacets.AggregatedValue, TaxonomyFacets.TopChildrenForPath
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AssociationAggregationFunction
Aggregation function used for combining values.(package private) IntIntHashMap
Sparse ordinal values.(package private) int[]
Dense ordinal values.Fields inherited from class org.apache.lucene.facet.taxonomy.TaxonomyFacets
config, counts, fc, indexFieldName, initialized, parents, sparseCounts, taxoReader, valueComparator
-
Constructor Summary
ConstructorsConstructorDescriptionIntTaxonomyFacets
(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config, AssociationAggregationFunction aggregationFunction, FacetsCollector fc) Sole constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected Number
Apply an aggregation to the two values and return the result.protected Number
getAggregationValue
(int ordinal) Get the aggregation value for this ordinal.(package private) int
getValue
(int ordinal) Get the value associated with this ordinal.protected void
protected TaxonomyFacets.AggregatedValue
private int
rollup
(int ord) protected void
setIncomingValue
(TopOrdAndNumberQueue.OrdAndValue incomingOrdAndValue, int ord) (package private) void
setValue
(int ordinal, int newValue) Set the value associated with this ordinal tonewValue
.protected void
updateValueFromRollup
(int ordinal, int childOrdinal) Roll-up the aggregation values fromchildOrdinal
toordinal
.Methods inherited from class org.apache.lucene.facet.taxonomy.TaxonomyFacets
childrenLoaded, getAllChildren, getAllDims, getChildren, getCount, getSiblings, getSpecificValue, getTopChildren, getTopChildrenForPath, getTopDims, hasValues, insertIntoQueue, makeTopOrdAndNumberQueue, missingAggregationValue, rollup, setCount, siblingsLoaded, verifyDim
Methods inherited from class org.apache.lucene.facet.Facets
validateTopN
-
Field Details
-
aggregationFunction
Aggregation function used for combining values. -
values
int[] valuesDense ordinal values. -
sparseValues
IntIntHashMap sparseValuesSparse ordinal values.
-
-
Constructor Details
-
IntTaxonomyFacets
IntTaxonomyFacets(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config, AssociationAggregationFunction aggregationFunction, FacetsCollector fc) throws IOException Sole constructor.- Throws:
IOException
-
-
Method Details
-
initializeValueCounters
protected void initializeValueCounters()- Overrides:
initializeValueCounters
in classTaxonomyFacets
-
setValue
void setValue(int ordinal, int newValue) Set the value associated with this ordinal tonewValue
. -
getValue
int getValue(int ordinal) Get the value associated with this ordinal. -
getAggregationValue
Description copied from class:TaxonomyFacets
Get the aggregation value for this ordinal.- Overrides:
getAggregationValue
in classTaxonomyFacets
-
aggregate
Description copied from class:TaxonomyFacets
Apply an aggregation to the two values and return the result.- Overrides:
aggregate
in classTaxonomyFacets
-
updateValueFromRollup
Description copied from class:TaxonomyFacets
Roll-up the aggregation values fromchildOrdinal
toordinal
. Overrides should probably call this to update the counts. Overriding allows us to work with primitive types for the aggregation values, keeping aggregation efficient.- Overrides:
updateValueFromRollup
in classTaxonomyFacets
- Throws:
IOException
-
rollup
- Throws:
IOException
-
setIncomingValue
- Overrides:
setIncomingValue
in classTaxonomyFacets
-
newAggregatedValue
- Overrides:
newAggregatedValue
in classTaxonomyFacets
-