Force merge into a single segment before getting the directory reader (#12138)

The test assumes a single segment is created (because only one scorer is created from the leaf contexts).

But, force merging wasn't done before getting the reader. Forcemerge to a single segment before getting the reader.
This commit is contained in:
Benjamin Trent 2023-02-09 11:27:08 -05:00 committed by GitHub
parent f38d51ee89
commit 7baa01b3c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -403,8 +403,8 @@ public class TestFeatureField extends LuceneTestCase {
pageRankDoc.add(pagerank); pageRankDoc.add(pagerank);
writer.addDocument(pageRankDoc); writer.addDocument(pageRankDoc);
reader = writer.getReader();
writer.forceMerge(1); writer.forceMerge(1);
reader = writer.getReader();
} }
IndexSearcher searcher = LuceneTestCase.newSearcher(reader); IndexSearcher searcher = LuceneTestCase.newSearcher(reader);