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 AssociationAggregationFunctionAggregation function used for combining values.(package private) IntIntHashMapSparse 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 NumberApply an aggregation to the two values and return the result.protected NumbergetAggregationValue(int ordinal) Get the aggregation value for this ordinal.(package private) intgetValue(int ordinal) Get the value associated with this ordinal.protected voidprotected TaxonomyFacets.AggregatedValueprivate introllup(int ord) protected voidsetIncomingValue(TopOrdAndNumberQueue.OrdAndValue incomingOrdAndValue, int ord) (package private) voidsetValue(int ordinal, int newValue) Set the value associated with this ordinal tonewValue.protected voidupdateValueFromRollup(int ordinal, int childOrdinal) Roll-up the aggregation values fromchildOrdinaltoordinal.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, verifyDimMethods 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:
initializeValueCountersin 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:TaxonomyFacetsGet the aggregation value for this ordinal.- Overrides:
getAggregationValuein classTaxonomyFacets
-
aggregate
Description copied from class:TaxonomyFacetsApply an aggregation to the two values and return the result.- Overrides:
aggregatein classTaxonomyFacets
-
updateValueFromRollup
Description copied from class:TaxonomyFacetsRoll-up the aggregation values fromchildOrdinaltoordinal. 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:
updateValueFromRollupin classTaxonomyFacets- Throws:
IOException
-
rollup
- Throws:
IOException
-
setIncomingValue
- Overrides:
setIncomingValuein classTaxonomyFacets
-
newAggregatedValue
- Overrides:
newAggregatedValuein classTaxonomyFacets
-