stefanvodita opened a new issue, #12585:
URL: https://github.com/apache/lucene/issues/12585

   ### Description
   
   In `IntTaxonomyFacets` and `FloatTaxonomyFacets` when we 
`getTopChildrenForPath` we maintain a priority queue of aggregation values and 
corresponding ordinals.
   If an aggregation value is not positive, we discard it 
([code](https://github.com/apache/lucene/blob/8b84f6c0965dda01514c196126ed10e57cb6d01a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/FloatTaxonomyFacets.java#L219)).
 If it is not larger than the lowest value in the queue (initially set to 0), 
we also discard it 
([code](https://github.com/apache/lucene/blob/8b84f6c0965dda01514c196126ed10e57cb6d01a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/FloatTaxonomyFacets.java#L222)).
   
   It looks like the facets assume aggregation results should be positive, but 
I think we could have negatives or zeroes. I wrote a [unit test to demo 
this](https://github.com/apache/lucene/commit/d1455fd9447011d1209f7f965afd6c1aa03ad5c1).
   The current behavior makes sense for counts. Counts are always non-negative 
and we probably don't care about counts of 0. But does it make sense for other 
aggregations?
   
   ### Version and environment details
   
   _No response_


-- 
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.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