java.lang.Object
org.apache.lucene.facet.Facets
org.apache.lucene.facet.taxonomy.TaxonomyFacets
org.apache.lucene.facet.taxonomy.FloatTaxonomyFacets
- Direct Known Subclasses:
TaxonomyFacetFloatAssociations
Base class for all taxonomy-based facets that aggregate to float.
-
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) IntFloatHashMapSparse ordinal values.(package private) float[]Dense ordinal values.Fields inherited from class org.apache.lucene.facet.taxonomy.TaxonomyFacets
config, counts, fc, indexFieldName, initialized, parents, sparseCounts, taxoReader, valueComparator -
Constructor Summary
ConstructorsConstructorDescriptionFloatTaxonomyFacets(String indexFieldName, TaxonomyReader taxoReader, AssociationAggregationFunction aggregationFunction, FacetsConfig config, 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) floatgetValue(int ordinal) Get the value associated with this ordinal.protected voidprotected TopOrdAndNumberQueuemakeTopOrdAndNumberQueue(int topN) Return aTopOrdAndNumberQueueof the appropriate type, i.e.protected NumberReturn the value for a missing aggregation, i.e.protected TaxonomyFacets.AggregatedValueprivate floatrollup(int ord) protected voidsetIncomingValue(TopOrdAndNumberQueue.OrdAndValue incomingOrdAndValue, int ord) (package private) voidsetValue(int ordinal, float 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, rollup, setCount, siblingsLoaded, verifyDimMethods inherited from class org.apache.lucene.facet.Facets
validateTopN
-
Field Details
-
aggregationFunction
Aggregation function used for combining values. -
values
float[] valuesDense ordinal values. -
sparseValues
IntFloatHashMap sparseValuesSparse ordinal values.
-
-
Constructor Details
-
FloatTaxonomyFacets
FloatTaxonomyFacets(String indexFieldName, TaxonomyReader taxoReader, AssociationAggregationFunction aggregationFunction, FacetsConfig config, FacetsCollector fc) throws IOException Sole constructor.- Throws:
IOException
-
-
Method Details
-
initializeValueCounters
protected void initializeValueCounters()- Overrides:
initializeValueCountersin classTaxonomyFacets
-
setValue
void setValue(int ordinal, float newValue) Set the value associated with this ordinal tonewValue. -
getValue
float 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
-
makeTopOrdAndNumberQueue
Description copied from class:TaxonomyFacetsReturn aTopOrdAndNumberQueueof the appropriate type, i.e. aTopOrdAndIntQueueor aTopOrdAndFloatQueue.- Overrides:
makeTopOrdAndNumberQueuein classTaxonomyFacets
-
missingAggregationValue
Description copied from class:TaxonomyFacetsReturn the value for a missing aggregation, i.e.-1or-1f.- Overrides:
missingAggregationValuein classTaxonomyFacets
-
rollup
- Throws:
IOException
-
setIncomingValue
- Overrides:
setIncomingValuein classTaxonomyFacets
-
newAggregatedValue
- Overrides:
newAggregatedValuein classTaxonomyFacets
-