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



##########
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:
       Ah, you are right. I got confused because this comment was linked to a 
previous version of your code that didn't use `FacetUtil#loadOrdinalValues` yet!




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