Skip to content

Commit bc90d74

Browse files
committed
Use newIndexSearcher() to avoid incompatible readers (elastic#52723)
Lucene's `newSearcher()` can generate readers like ParallelCompositeReader which we can't use. We need to instead use our helper `newIndexSearcher`
1 parent 9e22e09 commit bc90d74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ public void testSupportedFieldTypes() throws IOException {
645645
indexWriter.close();
646646

647647
try (IndexReader indexReader = DirectoryReader.open(directory)) {
648-
IndexSearcher indexSearcher = newSearcher(indexReader, true, true);
648+
IndexSearcher indexSearcher = newIndexSearcher(indexReader);
649649
AggregationBuilder aggregationBuilder = createAggBuilderForTypeTest(fieldType, fieldName);
650650

651651
// TODO in the future we can make this more explicit with expectThrows(), when the exceptions are standardized

0 commit comments

Comments
 (0)