Skip to content

Commit 9b48d6f

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

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,6 @@ protected AggregationBuilder createAggBuilderForTypeTest(MappedFieldType fieldTy
605605
*
606606
* Exception types/messages are not currently checked, just presence/absence of an exception.
607607
*/
608-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/52681")
609608
public void testSupportedFieldTypes() throws IOException {
610609
MapperRegistry mapperRegistry = new IndicesModule(Collections.emptyList()).getMapperRegistry();
611610
Settings settings = Settings.builder().put("index.version.created", Version.CURRENT.id).build();
@@ -647,7 +646,7 @@ public void testSupportedFieldTypes() throws IOException {
647646
indexWriter.close();
648647

649648
try (IndexReader indexReader = DirectoryReader.open(directory)) {
650-
IndexSearcher indexSearcher = newSearcher(indexReader, true, true);
649+
IndexSearcher indexSearcher = newIndexSearcher(indexReader);
651650
AggregationBuilder aggregationBuilder = createAggBuilderForTypeTest(fieldType, fieldName);
652651

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

0 commit comments

Comments
 (0)