percolator: Use correct version for bwc checking now that the change has been backported to 6.0 branch

This commit is contained in:
Martijn van Groningen 2017-08-09 13:49:11 +02:00
parent d8ff6e9831
commit 8285a0f399
No known key found for this signature in database
GPG Key ID: AB236F4FCF2AF12A
3 changed files with 4 additions and 4 deletions

View File

@ -591,7 +591,7 @@ public class PercolateQueryBuilder extends AbstractQueryBuilder<PercolateQueryBu
if (binaryDocValues == null) {
return docId -> 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();

View File

@ -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);

View File

@ -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));