msokolov commented on a change in pull request #718: URL: https://github.com/apache/lucene/pull/718#discussion_r819043542
########## File path: lucene/facet/src/java/org/apache/lucene/facet/taxonomy/IntTaxonomyFacets.java ########## @@ -173,17 +185,17 @@ public FacetResult getTopChildren(int topN, String dim, String... path) throws I if (sparseValues != null) { for (IntIntCursor c : sparseValues) { - int count = c.value; + int value = c.value; int ord = c.key; - if (parents[ord] == dimOrd && count > 0) { - totValue += count; + if (parents[ord] == dimOrd && value > 0) { + aggregatedValue = aggregationFunction.aggregate(aggregatedValue, value); childCount++; - if (count > bottomValue) { + if (value > bottomValue) { Review comment: I guess we need to ensure that aggregation functions are nondecreasing? I mean `min` wouldn't work very well here ########## File path: lucene/facet/src/java/org/apache/lucene/facet/taxonomy/FloatTaxonomyFacets.java ########## @@ -130,16 +140,16 @@ public FacetResult getTopChildren(int topN, String dim, String... path) throws I ord = siblings[ord]; } - if (sumValues == 0) { + if (aggregatedValue == 0) { return null; } if (dimConfig.multiValued) { if (dimConfig.requireDimCount) { - sumValues = values[dimOrd]; + aggregatedValue = values[dimOrd]; } else { // Our sum'd count is not correct, in general: Review comment: our "aggregated" count? -- 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