From 8285a0f3990365ecb33a363e06b0379baf0b27d1 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 9 Aug 2017 13:49:11 +0200 Subject: [PATCH] percolator: Use correct version for bwc checking now that the change has been backported to 6.0 branch --- .../org/elasticsearch/percolator/PercolateQueryBuilder.java | 2 +- .../org/elasticsearch/percolator/PercolatorFieldMapper.java | 4 ++-- .../org/elasticsearch/percolator/QueryBuilderStoreTests.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java index bfe764c2c16..30da327c81f 100644 --- a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java +++ b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java @@ -591,7 +591,7 @@ public class PercolateQueryBuilder extends AbstractQueryBuilder null; } - if (indexVersion.onOrAfter(Version.V_6_1_0)) { + if (indexVersion.onOrAfter(Version.V_6_0_0_beta2)) { return docId -> { if (binaryDocValues.advanceExact(docId)) { BytesRef qbSource = binaryDocValues.binaryValue(); diff --git a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorFieldMapper.java b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorFieldMapper.java index 7c386c7fcd2..d7efa90bb06 100644 --- a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorFieldMapper.java +++ b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorFieldMapper.java @@ -43,8 +43,8 @@ import org.elasticsearch.Version; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.OutputStreamStreamOutput; import org.elasticsearch.common.hash.MurmurHash3; +import org.elasticsearch.common.io.stream.OutputStreamStreamOutput; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; @@ -343,7 +343,7 @@ public class PercolatorFieldMapper extends FieldMapper { static void createQueryBuilderField(Version indexVersion, BinaryFieldMapper qbField, QueryBuilder queryBuilder, ParseContext context) throws IOException { - if (indexVersion.onOrAfter(Version.V_6_1_0)) { + if (indexVersion.onOrAfter(Version.V_6_0_0_beta2)) { try (ByteArrayOutputStream stream = new ByteArrayOutputStream()) { try (OutputStreamStreamOutput out = new OutputStreamStreamOutput(stream)) { out.setVersion(indexVersion); diff --git a/modules/percolator/src/test/java/org/elasticsearch/percolator/QueryBuilderStoreTests.java b/modules/percolator/src/test/java/org/elasticsearch/percolator/QueryBuilderStoreTests.java index 02fb8f0a885..5e97eadae83 100644 --- a/modules/percolator/src/test/java/org/elasticsearch/percolator/QueryBuilderStoreTests.java +++ b/modules/percolator/src/test/java/org/elasticsearch/percolator/QueryBuilderStoreTests.java @@ -74,7 +74,7 @@ public class QueryBuilderStoreTests extends ESTestCase { BinaryFieldMapper fieldMapper = PercolatorFieldMapper.Builder.createQueryBuilderFieldBuilder( new Mapper.BuilderContext(settings, new ContentPath(0))); - Version version = randomBoolean() ? Version.V_5_6_0 : Version.V_6_1_0; + Version version = randomBoolean() ? Version.V_5_6_0 : Version.V_6_0_0_beta2; try (IndexWriter indexWriter = new IndexWriter(directory, config)) { for (int i = 0; i < queryBuilders.length; i++) { queryBuilders[i] = new TermQueryBuilder(randomAlphaOfLength(4), randomAlphaOfLength(8));