test: don't randomly wrap index reader

This commit is contained in:
Martijn van Groningen 2017-04-26 21:07:33 +02:00
parent 0e52e3420e
commit ebe98f9d62
No known key found for this signature in database
GPG Key ID: AB236F4FCF2AF12A
2 changed files with 7 additions and 7 deletions

View File

@ -75,7 +75,7 @@ public class NestedAggregatorTests extends AggregatorTestCase {
NumberFieldMapper.NumberType.LONG);
fieldType.setName(VALUE_FIELD_NAME);
Nested nested = search(newSearcher(indexReader, true, true),
Nested nested = search(newSearcher(indexReader, false, true),
new MatchAllDocsQuery(), nestedBuilder, fieldType);
assertEquals(NESTED_AGG, nested.getName());
@ -122,7 +122,7 @@ public class NestedAggregatorTests extends AggregatorTestCase {
NumberFieldMapper.NumberType.LONG);
fieldType.setName(VALUE_FIELD_NAME);
Nested nested = search(newSearcher(indexReader, true, true),
Nested nested = search(newSearcher(indexReader, false, true),
new MatchAllDocsQuery(), nestedBuilder, fieldType);
assertEquals(expectedNestedDocs, nested.getDocCount());
@ -171,7 +171,7 @@ public class NestedAggregatorTests extends AggregatorTestCase {
NumberFieldMapper.NumberType.LONG);
fieldType.setName(VALUE_FIELD_NAME);
Nested nested = search(newSearcher(indexReader, true, true),
Nested nested = search(newSearcher(indexReader, false, true),
new MatchAllDocsQuery(), nestedBuilder, fieldType);
assertEquals(expectedNestedDocs, nested.getDocCount());
@ -223,7 +223,7 @@ public class NestedAggregatorTests extends AggregatorTestCase {
NumberFieldMapper.NumberType.LONG);
fieldType.setName(VALUE_FIELD_NAME);
Nested nested = search(newSearcher(indexReader, true, true),
Nested nested = search(newSearcher(indexReader, false, true),
new MatchAllDocsQuery(), nestedBuilder, fieldType);
assertEquals(expectedNestedDocs, nested.getDocCount());
@ -304,7 +304,7 @@ public class NestedAggregatorTests extends AggregatorTestCase {
bq.add(Queries.newNonNestedFilter(), BooleanClause.Occur.MUST);
bq.add(new TermQuery(new Term(UidFieldMapper.NAME, "type#2")), BooleanClause.Occur.MUST_NOT);
Nested nested = search(newSearcher(indexReader, true, true),
Nested nested = search(newSearcher(indexReader, false, true),
new ConstantScoreQuery(bq.build()), nestedBuilder, fieldType);
assertEquals(NESTED_AGG, nested.getName());

View File

@ -67,7 +67,7 @@ public class ReverseNestedAggregatorTests extends AggregatorTestCase {
NumberFieldMapper.NumberType.LONG);
fieldType.setName(VALUE_FIELD_NAME);
Nested nested = search(newSearcher(indexReader, true, true),
Nested nested = search(newSearcher(indexReader, false, true),
new MatchAllDocsQuery(), nestedBuilder, fieldType);
ReverseNested reverseNested = (ReverseNested)
((InternalAggregation)nested).getProperty(REVERSE_AGG_NAME);
@ -130,7 +130,7 @@ public class ReverseNestedAggregatorTests extends AggregatorTestCase {
NumberFieldMapper.NumberType.LONG);
fieldType.setName(VALUE_FIELD_NAME);
Nested nested = search(newSearcher(indexReader, true, true),
Nested nested = search(newSearcher(indexReader, false, true),
new MatchAllDocsQuery(), nestedBuilder, fieldType);
assertEquals(expectedNestedDocs, nested.getDocCount());