jpountz commented on a change in pull request #443:
URL: https://github.com/apache/lucene/pull/443#discussion_r752375283
##########
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:
@gsmiller Maybe we should recompute `useBinaryDv` on every
`MatchingDocs` instead of pre-computing it ahead of the loop based on the first
leaf of the index?
It's probably a corner-case for taxonomy-based faceting though since we
expect the main index and the taxonomy index to have been built side-by-side,
so we wouldn't expect users to bring in an index that has been built on the
side with a different creation version and plug it in through a MultiReader?
--
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]