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 AssociationAggregationFunction
Aggregation function used for combining values.(package private) IntFloatHashMap
Sparse 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 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) float
getValue
(int ordinal) Get the value associated with this ordinal.protected void
protected TopOrdAndNumberQueue
makeTopOrdAndNumberQueue
(int topN) Return aTopOrdAndNumberQueue
of the appropriate type, i.e.protected Number
Return the value for a missing aggregation, i.e.protected TaxonomyFacets.AggregatedValue
private float
rollup
(int ord) protected void
setIncomingValue
(TopOrdAndNumberQueue.OrdAndValue incomingOrdAndValue, int ord) (package private) void
setValue
(int ordinal, float 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, rollup, setCount, siblingsLoaded, verifyDim
Methods 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:
initializeValueCounters
in 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: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
-
makeTopOrdAndNumberQueue
Description copied from class:TaxonomyFacets
Return aTopOrdAndNumberQueue
of the appropriate type, i.e. aTopOrdAndIntQueue
or aTopOrdAndFloatQueue
.- Overrides:
makeTopOrdAndNumberQueue
in classTaxonomyFacets
-
missingAggregationValue
Description copied from class:TaxonomyFacets
Return the value for a missing aggregation, i.e.-1
or-1f
.- Overrides:
missingAggregationValue
in classTaxonomyFacets
-
rollup
- Throws:
IOException
-
setIncomingValue
- Overrides:
setIncomingValue
in classTaxonomyFacets
-
newAggregatedValue
- Overrides:
newAggregatedValue
in classTaxonomyFacets
-