diff options
author | Lee Hinman <lee@writequit.org> | 2017-06-06 12:06:00 -0600 |
---|---|---|
committer | Lee Hinman <lee@writequit.org> | 2017-06-08 14:37:44 -0600 |
commit | 119f8ed9f025c4280f5540fac1f6e2fb096c1df8 (patch) | |
tree | fedf9aef66fb5dd7c96829a6581e7769f953c7df /test/framework | |
parent | 3f6d80aa662bb757dfb5afd8d946309e162fcf08 (diff) |
Correctly enable _all for older 5.x indices
When we disabled `_all` by default for indices created in 6.0, we missed adding
a layer that would handle the situation where `_all` was not enabled in 5.x and
then the cluster was updated to 6.0, this means that when the cluster was
updated the `_all` field would be disabled for 5.x indices and field values
would not be added to the `_all` field.
This adds a compatibility layer for 5.x indices where we treat the default
enabled value for the `_all` field to be `true` if unset on 5.x indices.
Resolves #25068
Diffstat (limited to 'test/framework')
-rw-r--r-- | test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java index ee00da25f8..f2b166fcd6 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java @@ -147,6 +147,8 @@ public abstract class AbstractQueryTestCase<QB extends AbstractQueryBuilder<QB>> DOUBLE_FIELD_NAME, BOOLEAN_FIELD_NAME, DATE_FIELD_NAME, DATE_RANGE_FIELD_NAME, GEO_POINT_FIELD_NAME, }; private static final int NUMBER_OF_TESTQUERIES = 20; + protected static Version indexVersionCreated; + private static ServiceHolder serviceHolder; private static int queryNameId = 0; private static Settings nodeSettings; @@ -185,8 +187,8 @@ public abstract class AbstractQueryTestCase<QB extends AbstractQueryBuilder<QB>> protected Settings indexSettings() { // we have to prefer CURRENT since with the range of versions we support it's rather unlikely to get the current actually. - Version indexVersionCreated = randomBoolean() ? Version.CURRENT - : VersionUtils.randomVersionBetween(random(), null, Version.CURRENT); + indexVersionCreated = randomBoolean() ? Version.CURRENT + : VersionUtils.randomVersionBetween(random(), null, Version.CURRENT); return Settings.builder() .put(IndexMetaData.SETTING_VERSION_CREATED, indexVersionCreated) .build(); |