[Rollup] Don't use lucene's newSearcher() method in tests
Use AggregatorTestCase's `newIndexSearcher()` instead. Lucene's version can randomly wrap with IndexReader with things we can't handle like ParallelCompositeReader Original commit: elastic/x-pack-elasticsearch@b4c0e9a601
This commit is contained in:
parent
faac0d2a52
commit
933738c264
|
@ -896,7 +896,7 @@ public class RollupResponseTranslationTests extends AggregatorTestCase {
|
||||||
indexWriter.close();
|
indexWriter.close();
|
||||||
|
|
||||||
IndexReader indexReader = DirectoryReader.open(directory);
|
IndexReader indexReader = DirectoryReader.open(directory);
|
||||||
IndexSearcher indexSearcher = newSearcher(indexReader, true, true);
|
IndexSearcher indexSearcher = newIndexSearcher(indexReader);
|
||||||
|
|
||||||
Aggregator aggregator = createAggregator(aggBuilder, indexSearcher, fieldType);
|
Aggregator aggregator = createAggregator(aggBuilder, indexSearcher, fieldType);
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class IndexerUtilsTests extends AggregatorTestCase {
|
||||||
indexWriter.close();
|
indexWriter.close();
|
||||||
|
|
||||||
IndexReader indexReader = DirectoryReader.open(directory);
|
IndexReader indexReader = DirectoryReader.open(directory);
|
||||||
IndexSearcher indexSearcher = newSearcher(indexReader, true, true);
|
IndexSearcher indexSearcher = newIndexSearcher(indexReader);
|
||||||
|
|
||||||
DateFieldMapper.Builder builder = new DateFieldMapper.Builder(timestampField);
|
DateFieldMapper.Builder builder = new DateFieldMapper.Builder(timestampField);
|
||||||
DateFieldMapper.DateFieldType timestampFieldType = builder.fieldType();
|
DateFieldMapper.DateFieldType timestampFieldType = builder.fieldType();
|
||||||
|
@ -144,7 +144,7 @@ public class IndexerUtilsTests extends AggregatorTestCase {
|
||||||
indexWriter.close();
|
indexWriter.close();
|
||||||
|
|
||||||
IndexReader indexReader = DirectoryReader.open(directory);
|
IndexReader indexReader = DirectoryReader.open(directory);
|
||||||
IndexSearcher indexSearcher = newSearcher(indexReader, true, true);
|
IndexSearcher indexSearcher = newIndexSearcher(indexReader);
|
||||||
|
|
||||||
DateFieldMapper.Builder builder = new DateFieldMapper.Builder(timestampField);
|
DateFieldMapper.Builder builder = new DateFieldMapper.Builder(timestampField);
|
||||||
DateFieldMapper.DateFieldType timestampFieldType = builder.fieldType();
|
DateFieldMapper.DateFieldType timestampFieldType = builder.fieldType();
|
||||||
|
@ -216,7 +216,7 @@ public class IndexerUtilsTests extends AggregatorTestCase {
|
||||||
indexWriter.close();
|
indexWriter.close();
|
||||||
|
|
||||||
IndexReader indexReader = DirectoryReader.open(directory);
|
IndexReader indexReader = DirectoryReader.open(directory);
|
||||||
IndexSearcher indexSearcher = newSearcher(indexReader, true, true);
|
IndexSearcher indexSearcher = newIndexSearcher(indexReader);
|
||||||
|
|
||||||
MappedFieldType valueFieldType = new NumberFieldMapper.NumberFieldType(NumberFieldMapper.NumberType.LONG);
|
MappedFieldType valueFieldType = new NumberFieldMapper.NumberFieldType(NumberFieldMapper.NumberType.LONG);
|
||||||
valueFieldType.setName(valueField);
|
valueFieldType.setName(valueField);
|
||||||
|
@ -281,7 +281,7 @@ public class IndexerUtilsTests extends AggregatorTestCase {
|
||||||
indexWriter.close();
|
indexWriter.close();
|
||||||
|
|
||||||
IndexReader indexReader = DirectoryReader.open(directory);
|
IndexReader indexReader = DirectoryReader.open(directory);
|
||||||
IndexSearcher indexSearcher = newSearcher(indexReader, true, true);
|
IndexSearcher indexSearcher = newIndexSearcher(indexReader);
|
||||||
|
|
||||||
DateFieldMapper.Builder builder = new DateFieldMapper.Builder(timestampField);
|
DateFieldMapper.Builder builder = new DateFieldMapper.Builder(timestampField);
|
||||||
DateFieldMapper.DateFieldType timestampFieldType = builder.fieldType();
|
DateFieldMapper.DateFieldType timestampFieldType = builder.fieldType();
|
||||||
|
|
Loading…
Reference in New Issue