stefanvodita commented on code in PR #12547:
URL: https://github.com/apache/lucene/pull/12547#discussion_r1377483050


##########
lucene/facet/src/java/org/apache/lucene/facet/taxonomy/FloatTaxonomyFacets.java:
##########
@@ -37,33 +37,43 @@ abstract class FloatTaxonomyFacets extends TaxonomyFacets {
 
   // TODO: also use native hash map for sparse collection, like 
IntTaxonomyFacets
 
-  /** Aggregation function used for combining values. */
-  final AssociationAggregationFunction aggregationFunction;
+  /** Aggregation functions used for combining values. */
+  final List<AssociationAggregationFunction> aggregationFunctions;
 
   /** Per-ordinal value. */
-  float[] values;
+  float[][] values;
+
+  @Override
+  boolean hasValues() {
+    return values != null;
+  }
+
+  void initializeValueCounters() {
+    if (values == null) {
+      values = new float[aggregationFunctions.size()][taxoReader.getSize()];

Review Comment:
   That is correct. Compare `initializeValueCounters` for 
[`IntTaxonomyFacets`](https://github.com/apache/lucene/blob/main/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/IntTaxonomyFacets.java#L69)
 and 
[`FloatTaxonomyFacets`](https://github.com/apache/lucene/blob/main/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/FloatTaxonomyFacets.java#L63).
 I don't think there's a good reason for `Int/FloatTaxonomyFacets` to differ 
here. Maybe sparse values just never got implemented for  `FloatTaxonomyFacets`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to