Fix TermsAggregatorTests to not use LuceneTestCase.newSearcher since it needs a DirectoryReader.

This commit is contained in:
Adrien Grand 2016-12-30 10:12:24 +01:00
parent f89bb18a5d
commit f1d7721932
1 changed files with 2 additions and 1 deletions

View File

@ -52,7 +52,8 @@ public class TermsAggregatorTests extends AggregatorTestCase {
indexWriter.close();
IndexReader indexReader = DirectoryReader.open(directory);
IndexSearcher indexSearcher = newSearcher(indexReader, true, true);
// We do not use LuceneTestCase.newSearcher because we need a DirectoryReader
IndexSearcher indexSearcher = new IndexSearcher(indexReader);
for (TermsAggregatorFactory.ExecutionMode executionMode : TermsAggregatorFactory.ExecutionMode.values()) {
TermsAggregationBuilder aggregationBuilder = new TermsAggregationBuilder("_name", ValueType.STRING)