Apache Solr open-source search software
SOLR-17631: Fixing ords handling in DocValuesFacets, fixes TestRandomDVFaceting
Ishan Chattopadhyaya5a0e7f47504f
diff --git a/solr/core/src/java/org/apache/solr/request/DocValuesFacets.java b/solr/core/src/java/org/apache/solr/request/DocValuesFacets.javaindex 0638bb34864..5b66da544fe 100644--- a/solr/core/src/java/org/apache/solr/request/DocValuesFacets.java+++ b/solr/core/src/java/org/apache/solr/request/DocValuesFacets.java@@ -429,9 +429,8 @@ public class DocValuesFacets {} while ((term = (int) si.nextOrd()) >= 0);*/for (int o = 0; o < si.docValueCount(); o++) {long ord = si.nextOrd();- if (ord == DocIdSetIterator.NO_MORE_DOCS)- break; // nocommit this shouldn't have been needed, but without this the- // TestRandomDVFaceting is failing. Why?+ if (ord == -1) // NO_MORE_ORDS+ break;int term = (int) ord;if (map != null) {term = (int) ordMap.get(term);@@ -465,9 +464,8 @@ public class DocValuesFacets {if (si.advanceExact(doc)) {for (int o = 0; o < si.docValueCount(); o++) {long ord = si.nextOrd();- if (ord == DocIdSetIterator.NO_MORE_DOCS)- break; // nocommit this shouldn't have been needed, but without this the- // TestRandomDVFaceting is failing. Why?+ if (ord == -1) // NO_MORE_ORDS+ break;int term = (int) ord;segCounts[1 + term]++;}