gsmiller commented on a change in pull request #443:
URL: https://github.com/apache/lucene/pull/443#discussion_r752406697
##########
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:
Thanks @jpountz. I _think_ I'm effectively doing this now in the latest
revision with since `FacetUtil#loadOrdinalValues` does the check for the
provided leaf when determining what format to expect, and that is invoked for
each `MatchingDocs` instance. So I _think_ we're covered here.
--
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]