gsmiller commented on a change in pull request #443: URL: https://github.com/apache/lucene/pull/443#discussion_r751365695
########## File path: lucene/facet/src/java/org/apache/lucene/facet/taxonomy/DocValuesOrdinalsReader.java ########## @@ -41,13 +48,21 @@ public DocValuesOrdinalsReader(String field) { @Override public OrdinalsSegmentReader getReader(LeafReaderContext context) throws IOException { - BinaryDocValues values0 = context.reader().getBinaryDocValues(field); - if (values0 == null) { - values0 = DocValues.emptyBinary(); + final SortedNumericDocValues dv; + if (FacetUtils.usesOlderBinaryOrdinals(context.reader())) { + // Wrap the binary values so they appear as numeric doc values. Delegate to the #decode method + // so sub-class decoding implementations are honored: + SortedNumericDocValues wrapped = + BackCompatSortedNumericDocValues.wrap( + context.reader().getBinaryDocValues(field), this::decode); Review comment: It's a bit wonky for sure, but I think this is necessary to truly be backwards compatible. The issue is that users could be extending `DocValuesOrdinalsReader` and implementing their own custom `decode` logic. So this "hook" makes sure we delegate to the `decode` method in case the user is doing that. -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org