gsmiller commented on a change in pull request #443:
URL: https://github.com/apache/lucene/pull/443#discussion_r751455429



##########
File path: 
lucene/facet/src/java/org/apache/lucene/facet/taxonomy/FastTaxonomyFacetCounts.java
##########
@@ -69,31 +69,34 @@ public FastTaxonomyFacetCounts(
   }
 
   private final void count(List<MatchingDocs> matchingDocs) throws IOException 
{
+    if (matchingDocs.isEmpty()) {
+      return;
+    }
+
+    boolean useBinaryDv = 
FacetUtils.usesOlderBinaryOrdinals(matchingDocs.get(0).context.reader());
+
     for (MatchingDocs hits : matchingDocs) {
-      BinaryDocValues dv = 
hits.context.reader().getBinaryDocValues(indexFieldName);
-      if (dv == null) { // this reader does not have DocValues for the 
requested category list
+      assert useBinaryDv == 
FacetUtils.usesOlderBinaryOrdinals(hits.context.reader());

Review comment:
       I actually wasn't aware that it's global, but from @jpountz, it sounds 
like it is. Even if it's segment-level, we would always expect it to be 
homogenous here given that we don't mix formats across segments when writing.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to