mikemccand commented on a change in pull request #131:
URL: https://github.com/apache/lucene/pull/131#discussion_r634369094



##########
File path: 
lucene/facet/src/test/org/apache/lucene/facet/TestLongValueFacetCounts.java
##########
@@ -429,15 +429,15 @@ public void testRandomMultiValued() throws Exception {
       int expectedChildCount = 0;
       int expectedTotalCount = 0;
       for (int i = 0; i < valueCount; i++) {
-        if (values[i] != null) {
+        if (values[i] != null && values[i].length > 0) {

Review comment:
       I *think* if a single document contains the same numeric value more than 
once, indexed as a `SortedNumericDocValuesField`, Lucene will indeed index that 
number multiple times for that document, and then this facet counting 
implementation will count it multiple times for that one value, right?
   
   Or does Lucene de-dup such duplicate numeric values in one document?  I'm 
not certain :)
   
   Ideally, it should only count that value once for that document, but it 
over-counts today.
   
   However, this is a different bug than what this PR is fixing -- so let's 
keep this PR about the original bug of not overcounting the `FacetResult.value`?




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

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