gautamworah96 commented on a change in pull request #2247: URL: https://github.com/apache/lucene-solr/pull/2247#discussion_r564970251
########## File path: lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyReader.java ########## @@ -353,12 +349,65 @@ public FacetLabel getPath(int ordinal) throws IOException { } synchronized (categoryCache) { - categoryCache.put(catIDInteger, ret); + categoryCache.put(ordinal, ret); } return ret; } + private FacetLabel getPathFromCache(int ordinal) { + ensureOpen(); + + // TODO: can we use an int-based hash impl, such as IntToObjectMap, + // wrapped as LRU? + synchronized (categoryCache) { + FacetLabel res = categoryCache.get(ordinal); + if (res != null) { + return res; + } + } + return null; + } + + /* This API is only supported for indexes created with Lucene 8.7+ codec **/ + public FacetLabel[] getBulkPath(int[] ordinal) throws IOException { Review comment: I was also confused as to why the method above this one is named `getPath` and not `getLabel` or `getFacetLabel`. I chose `getBulkPath` to maintain consistency. ---------------------------------------------------------------- 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