mikemccand commented on a change in pull request #1733: URL: https://github.com/apache/lucene-solr/pull/1733#discussion_r474059462
########## File path: lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyReader.java ########## @@ -322,9 +324,14 @@ public FacetLabel getPath(int ordinal) throws IOException { return res; } } - - Document doc = indexReader.document(ordinal); - FacetLabel ret = new FacetLabel(FacetsConfig.stringToPath(doc.get(Consts.FULL))); + + int readerIndex = ReaderUtil.subIndex(ordinal, indexReader.leaves()); + LeafReader leafReader = indexReader.leaves().get(readerIndex).reader(); + BinaryDocValues values = leafReader.getBinaryDocValues(Consts.FULL); Review comment: Could you open a new issue to optimize this better in the future, to do bulk lookup of `ordinal -> FacetLabel`? And then add a `// TODO ` pointing to that issue and describing the optimization? ---------------------------------------------------------------- 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. 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