Skip to content

Commit

Permalink
Adding patch version from 8.16 for skip_inner_hits_search_source (ela…
Browse files Browse the repository at this point in the history
  • Loading branch information
pmpailis authored Nov 13, 2024
1 parent d6b2425 commit 7cae545
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ static TransportVersion def(int id) {
public static final TransportVersion CONVERT_FAILURE_STORE_OPTIONS_TO_SELECTOR_OPTIONS_INTERNALLY = def(8_772_00_0);
public static final TransportVersion INFERENCE_DONT_PERSIST_ON_READ_BACKPORT_8_16 = def(8_772_00_1);
public static final TransportVersion ADD_COMPATIBILITY_VERSIONS_TO_NODE_INFO_BACKPORT_8_16 = def(8_772_00_2);
public static final TransportVersion SKIP_INNER_HITS_SEARCH_SOURCE_BACKPORT_8_16 = def(8_772_00_3);
public static final TransportVersion REMOVE_MIN_COMPATIBLE_SHARD_NODE = def(8_773_00_0);
public static final TransportVersion REVERT_REMOVE_MIN_COMPATIBLE_SHARD_NODE = def(8_774_00_0);
public static final TransportVersion ESQL_FIELD_ATTRIBUTE_PARENT_SIMPLIFIED = def(8_775_00_0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ public SearchSourceBuilder(StreamInput in) throws IOException {
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) {
rankBuilder = in.readOptionalNamedWriteable(RankBuilder.class);
}
if (in.getTransportVersion().onOrAfter(TransportVersions.SKIP_INNER_HITS_SEARCH_SOURCE)) {
if (in.getTransportVersion().isPatchFrom(TransportVersions.SKIP_INNER_HITS_SEARCH_SOURCE_BACKPORT_8_16)
|| in.getTransportVersion().onOrAfter(TransportVersions.SKIP_INNER_HITS_SEARCH_SOURCE)) {
skipInnerHits = in.readBoolean();
} else {
skipInnerHits = false;
Expand Down Expand Up @@ -385,7 +386,8 @@ public void writeTo(StreamOutput out) throws IOException {
} else if (rankBuilder != null) {
throw new IllegalArgumentException("cannot serialize [rank] to version [" + out.getTransportVersion().toReleaseVersion() + "]");
}
if (out.getTransportVersion().onOrAfter(TransportVersions.SKIP_INNER_HITS_SEARCH_SOURCE)) {
if (out.getTransportVersion().isPatchFrom(TransportVersions.SKIP_INNER_HITS_SEARCH_SOURCE_BACKPORT_8_16)
|| out.getTransportVersion().onOrAfter(TransportVersions.SKIP_INNER_HITS_SEARCH_SOURCE)) {
out.writeBoolean(skipInnerHits);
}
}
Expand Down Expand Up @@ -1866,9 +1868,6 @@ public XContentBuilder innerToXContent(XContentBuilder builder, Params params) t
if (false == runtimeMappings.isEmpty()) {
builder.field(RUNTIME_MAPPINGS_FIELD.getPreferredName(), runtimeMappings);
}
if (skipInnerHits) {
builder.field("skipInnerHits", true);
}

return builder;
}
Expand Down

0 comments on commit 7cae545

Please sign in to comment.