gf2121 commented on code in PR #12912: URL: https://github.com/apache/lucene/pull/12912#discussion_r1422443348
########## lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java: ########## @@ -2265,4 +2268,47 @@ public void testReadNMinusTwoSegmentInfos() throws IOException { } } } + + public static final String[] oldWikiTermsNames = {"wikiterms.9.8.0.zip"}; + + public void testCreateWikiTermsIndex() throws Exception { + Path indexDir = getIndexDir().resolve("wikiterms"); + Files.deleteIfExists(indexDir); + Directory dir = newFSDirectory(indexDir); + + IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig()); + BytesRefIterator termsEnum = TermsTestUtil.load(TermsTestUtil.WIKI_40000_TERMS_FILE); + BytesRef term; + while ((term = termsEnum.next()) != null) { + Document document = new Document(); + document.add(new StringField("body", term, Field.Store.NO)); + writer.addDocument(document); + } + + writer.flush(); + writer.commit(); + writer.forceMerge(1); + writer.close(); + dir.close(); + + // Gives you time to copy the index out!: (there is also + // a test option to not remove temp dir...): + Thread.sleep(100000); Review Comment: Thanks for review @uschindler @benwtrent ! I closed this since I say @mikemccand [did](https://github.com/apache/lucene/issues/12901#issuecomment-1849981059) similar things and his dictionary is much smaller than mine :) > this must go away, please add nocommit. I'm very new to this part. I copied this pattern from another [existing test ](https://github.com/apache/lucene/blob/069c04877011a7e305dfd9e23e194fe4fd5b59e6/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java#L228). I can open another PR to clean this up if we are sure it makes no sense. ########## lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java: ########## @@ -2265,4 +2268,47 @@ public void testReadNMinusTwoSegmentInfos() throws IOException { } } } + + public static final String[] oldWikiTermsNames = {"wikiterms.9.8.0.zip"}; + + public void testCreateWikiTermsIndex() throws Exception { + Path indexDir = getIndexDir().resolve("wikiterms"); + Files.deleteIfExists(indexDir); + Directory dir = newFSDirectory(indexDir); + + IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig()); + BytesRefIterator termsEnum = TermsTestUtil.load(TermsTestUtil.WIKI_40000_TERMS_FILE); + BytesRef term; + while ((term = termsEnum.next()) != null) { + Document document = new Document(); + document.add(new StringField("body", term, Field.Store.NO)); + writer.addDocument(document); + } + + writer.flush(); + writer.commit(); + writer.forceMerge(1); + writer.close(); + dir.close(); + + // Gives you time to copy the index out!: (there is also + // a test option to not remove temp dir...): + Thread.sleep(100000); Review Comment: Thanks for review @uschindler @benwtrent ! I closed this since I saw @mikemccand [did](https://github.com/apache/lucene/issues/12901#issuecomment-1849981059) similar things and his dictionary is much smaller than mine :) > this must go away, please add nocommit. I'm very new to this part. I copied this pattern from another [existing test ](https://github.com/apache/lucene/blob/069c04877011a7e305dfd9e23e194fe4fd5b59e6/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java#L228). I can open another PR to clean this up if we are sure it makes no sense. -- 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