mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-26 06:46:10 +00:00
Fix TophitsAggregatorTests
It needs a DirectoryReader so it has to be careful. Closes #22818
This commit is contained in:
parent
33fd1a606b
commit
1baa884ab7
@ -130,7 +130,8 @@ public class TopHitsAggregatorTests extends AggregatorTestCase {
|
||||
iw.close();
|
||||
|
||||
IndexReader indexReader = DirectoryReader.open(directory);
|
||||
IndexSearcher indexSearcher = newSearcher(indexReader, true, true);
|
||||
// We do not use LuceneTestCase.newSearcher because we need a DirectoryReader for "testInsideTerms"
|
||||
IndexSearcher indexSearcher = new IndexSearcher(indexReader);
|
||||
|
||||
Aggregation result = searchAndReduce(indexSearcher, query, builder, STRING_FIELD_TYPE);
|
||||
indexReader.close();
|
||||
|
Loading…
x
Reference in New Issue
Block a user