Change serialization version of doc-value fields.

Relates #29639
This commit is contained in:
Adrien Grand 2018-05-23 14:47:09 +02:00
parent fcd54cdb7c
commit 405eb7a751
7 changed files with 13 additions and 13 deletions

View File

@ -45,7 +45,7 @@ setup:
"Nested doc version and seqIDs":
- skip:
version: " - 6.99.99" # TODO change to 6.3.99 on backport
version: " - 6.3.99"
reason: "object notation for docvalue_fields was introduced in 6.4"
- do:

View File

@ -134,7 +134,7 @@ setup:
---
"docvalue_fields":
- skip:
version: " - 6.99.99" # TODO: change version on backport
version: " - 6.3.99"
reason: format option was added in 6.4
features: warnings
- do:
@ -148,7 +148,7 @@ setup:
---
"docvalue_fields as url param":
- skip:
version: " - 6.99.99" # TODO: change version on backport
version: " - 6.3.99"
reason: format option was added in 6.4
features: warnings
- do:
@ -161,7 +161,7 @@ setup:
---
"docvalue_fields with default format":
- skip:
version: " - 6.99.99" # TODO: change version on backport
version: " - 6.3.99"
reason: format option was added in 6.4
- do:
search:
@ -174,7 +174,7 @@ setup:
---
"docvalue_fields with explicit format":
- skip:
version: " - 6.99.99" # TODO: change version on backport
version: " - 6.3.99"
reason: format option was added in 6.4
- do:
search:

View File

@ -63,7 +63,7 @@ setup:
"Docvalues_fields size limit":
- skip:
version: " - 6.99.99" # TODO: change to 6.3.99 on backport
version: " - 6.3.99"
reason: "The object notation for docvalue_fields is only supported on 6.4+"
- do:
catch: /Trying to retrieve too many docvalue_fields\. Must be less than or equal to[:] \[2\] but was \[3\]\. This limit can be set by changing the \[index.max_docvalue_fields_search\] index level setting\./

View File

@ -137,7 +137,7 @@ public final class InnerHitBuilder implements Writeable, ToXContentObject {
version = in.readBoolean();
trackScores = in.readBoolean();
storedFieldsContext = in.readOptionalWriteable(StoredFieldsContext::new);
if (in.getVersion().before(Version.V_7_0_0_alpha1)) { // TODO: change to 6.4.0 after backport
if (in.getVersion().before(Version.V_6_4_0)) {
List<String> fieldList = (List<String>) in.readGenericValue();
if (fieldList == null) {
docValueFields = null;
@ -188,7 +188,7 @@ public final class InnerHitBuilder implements Writeable, ToXContentObject {
out.writeBoolean(version);
out.writeBoolean(trackScores);
out.writeOptionalWriteable(storedFieldsContext);
if (out.getVersion().before(Version.V_7_0_0_alpha1)) { // TODO: change to 6.4.0 after backport
if (out.getVersion().before(Version.V_6_4_0)) {
out.writeGenericValue(docValueFields == null
? null
: docValueFields.stream().map(ff -> ff.field).collect(Collectors.toList()));

View File

@ -199,7 +199,7 @@ public final class SearchSourceBuilder implements Writeable, ToXContentObject, R
aggregations = in.readOptionalWriteable(AggregatorFactories.Builder::new);
explain = in.readOptionalBoolean();
fetchSourceContext = in.readOptionalWriteable(FetchSourceContext::new);
if (in.getVersion().before(Version.V_7_0_0_alpha1)) { // TODO: change to 6.4.0 after backport
if (in.getVersion().before(Version.V_6_4_0)) {
List<String> dvFields = (List<String>) in.readGenericValue();
if (dvFields == null) {
docValueFields = null;
@ -263,7 +263,7 @@ public final class SearchSourceBuilder implements Writeable, ToXContentObject, R
out.writeOptionalWriteable(aggregations);
out.writeOptionalBoolean(explain);
out.writeOptionalWriteable(fetchSourceContext);
if (out.getVersion().before(Version.V_7_0_0_alpha1)) { // TODO: change to 6.4.0 after backport
if (out.getVersion().before(Version.V_6_4_0)) {
out.writeGenericValue(docValueFields == null
? null
: docValueFields.stream().map(ff -> ff.field).collect(Collectors.toList()));

View File

@ -80,7 +80,7 @@ public class DocValueFieldsContext {
/** Serialization constructor. */
public FieldAndFormat(StreamInput in) throws IOException {
this.field = in.readString();
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) { // TODO: change to 6.4.0 after backport
if (in.getVersion().onOrAfter(Version.V_6_4_0)) {
format = in.readOptionalString();
} else {
format = null;
@ -90,7 +90,7 @@ public class DocValueFieldsContext {
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeString(field);
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) { // TODO: change to 6.4.0 after backport
if (out.getVersion().onOrAfter(Version.V_6_4_0)) {
out.writeOptionalString(format);
}
}

View File

@ -1,7 +1,7 @@
---
"Translate SQL":
- skip:
version: " - 6.99.99" # TODO: change version on backport
version: " - 6.3.99"
reason: format option was added in 6.4
features: warnings