Fix rare bug in TestKnnVectorQuery when we have multiple segments

This commit is contained in:
Michael Sokolov 2022-09-18 20:21:39 +00:00
parent 451bab300e
commit e69c48b8d9
1 changed files with 1 additions and 1 deletions

View File

@ -833,7 +833,7 @@ public class TestKnnVectorQuery extends LuceneTestCase {
*/ */
private Directory getStableIndexStore(String field, float[]... contents) throws IOException { private Directory getStableIndexStore(String field, float[]... contents) throws IOException {
Directory indexStore = newDirectory(); Directory indexStore = newDirectory();
try (IndexWriter writer = new IndexWriter(indexStore, newIndexWriterConfig())) { try (IndexWriter writer = new IndexWriter(indexStore, new IndexWriterConfig())) {
VectorEncoding encoding = randomVectorEncoding(); VectorEncoding encoding = randomVectorEncoding();
for (int i = 0; i < contents.length; ++i) { for (int i = 0; i < contents.length; ++i) {
Document doc = new Document(); Document doc = new Document();