From 092061f6043689c9ebb41a120cf62315f337bdc9 Mon Sep 17 00:00:00 2001 From: Marios Trivyzas Date: Tue, 16 Feb 2021 14:09:05 +0200 Subject: [PATCH] Update versions after backport of `max_analyzed_offset` Since #69016 is merged versions for serialisation/deserialisation and YAML tests are updated. Follows: #67325 --- .../search.highlight/30_max_analyzed_offset.yml | 16 ++++++++-------- .../highlight/AbstractHighlighterBuilder.java | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search.highlight/30_max_analyzed_offset.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search.highlight/30_max_analyzed_offset.yml index 6c1c0c609f83b..828293be114e6 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search.highlight/30_max_analyzed_offset.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search.highlight/30_max_analyzed_offset.yml @@ -41,8 +41,8 @@ setup: "Unified highlighter on a field WITHOUT OFFSETS exceeding index.highlight.max_analyzed_offset with max_analyzed_offset=20 should SUCCEED": - skip: - version: " - 7.99.99" - reason: max_analyzed_offset query param added in 8.0 + version: " - 7.11.99" + reason: max_analyzed_offset query param added in 7.12.0 - do: search: @@ -67,8 +67,8 @@ setup: "Plain highlighter on a field WITHOUT OFFSETS exceeding index.highlight.max_analyzed_offset with max_analyzed_offset=20 should SUCCEED": - skip: - version: " - 7.99.99" - reason: max_analyzed_offset query param added in 8.0 + version: " - 7.11.99" + reason: max_analyzed_offset query param added in 7.12.0 - do: search: @@ -104,8 +104,8 @@ setup: "Plain highlighter on a field WITH OFFSETS exceeding index.highlight.max_analyzed_offset with max_analyzed_offset=20 should SUCCEED": - skip: - version: " - 7.99.99" - reason: max_analyzed_offset query param added in 8.0 + version: " - 7.11.99" + reason: max_analyzed_offset query param added in 7.12.0 - do: search: @@ -118,8 +118,8 @@ setup: "Plain highlighter with max_analyzed_offset < 0 should FAIL": - skip: - version: " - 7.99.99" - reason: max_analyzed_offset query param added in 8.0 + version: " - 7.11.99" + reason: max_analyzed_offset query param added in 7.12.0 - do: catch: bad_request diff --git a/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java b/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java index 491d9bea6b165..fc9636d819f83 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java @@ -159,7 +159,7 @@ protected AbstractHighlighterBuilder(StreamInput in) throws IOException { options(in.readMap()); } requireFieldMatch(in.readOptionalBoolean()); - if (in.getVersion().onOrAfter(Version.V_8_0_0)) { + if (in.getVersion().onOrAfter(Version.V_7_12_0)) { maxAnalyzedOffset(in.readOptionalInt()); } } @@ -203,7 +203,7 @@ public final void writeTo(StreamOutput out) throws IOException { out.writeMap(options); } out.writeOptionalBoolean(requireFieldMatch); - if (out.getVersion().onOrAfter(Version.V_8_0_0)) { + if (out.getVersion().onOrAfter(Version.V_7_12_0)) { out.writeOptionalInt(maxAnalyzedOffset); } doWriteTo(out);