msfroh commented on code in PR #13028: URL: https://github.com/apache/lucene/pull/13028#discussion_r1462133413
########## lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestTaxonomyIndexArrays.java: ########## @@ -59,4 +64,22 @@ public void testMultiplesOfChunkSize() { ordinal = newOrdinal; } } + + public void testConstructFromEmptyIndex() throws IOException { + Directory dir = newDirectory(); + + // Produce empty index + new IndexWriter(dir, newIndexWriterConfig(null)).close(); + + IndexReader reader = DirectoryReader.open(dir); + + TaxonomyIndexArrays tia = new TaxonomyIndexArrays(reader); + assertEquals(0, tia.parents().length()); Review Comment: Oh -- interesting. I didn't realize this was a valid use-case. If you open a TaxonomyWriter, you're currently guaranteed to get at least one (root) document. -- 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