Skip to content

Forward port 8.19 semantic text chunking config transport version #127722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Forward port 8.19 semantic text chunking config transport version
  • Loading branch information
Mikep86 committed May 5, 2025
commit 63da278bb9a050a75ad2b74e9589e7c72da8db12
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ static TransportVersion def(int id) {
public static final TransportVersion RERANK_COMMON_OPTIONS_ADDED_8_19 = def(8_841_0_15);
public static final TransportVersion REMOTE_EXCEPTION_8_19 = def(8_841_0_16);
public static final TransportVersion AMAZON_BEDROCK_TASK_SETTINGS_8_19 = def(8_841_0_17);
public static final TransportVersion SEMANTIC_TEXT_CHUNKING_CONFIG_8_19 = def(8_841_0_18);
public static final TransportVersion BATCHED_QUERY_PHASE_VERSION_BACKPORT_8_X = def(8_841_0_19);
public static final TransportVersion SEARCH_INCREMENTAL_TOP_DOCS_NULL_BACKPORT_8_19 = def(8_841_0_20);
public static final TransportVersion ML_INFERENCE_SAGEMAKER_8_19 = def(8_841_0_21);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import java.util.Objects;

import static org.elasticsearch.TransportVersions.SEMANTIC_TEXT_CHUNKING_CONFIG;
import static org.elasticsearch.TransportVersions.SEMANTIC_TEXT_CHUNKING_CONFIG_8_19;
import static org.elasticsearch.TransportVersions.V_9_0_0;

/**
* Contains inference field data for fields.
Expand Down Expand Up @@ -74,7 +76,8 @@ public InferenceFieldMetadata(StreamInput input) throws IOException {
this.searchInferenceId = this.inferenceId;
}
this.sourceFields = input.readStringArray();
if (input.getTransportVersion().onOrAfter(SEMANTIC_TEXT_CHUNKING_CONFIG)) {
if (input.getTransportVersion().onOrAfter(SEMANTIC_TEXT_CHUNKING_CONFIG)
|| input.getTransportVersion().between(SEMANTIC_TEXT_CHUNKING_CONFIG_8_19, V_9_0_0)) {
this.chunkingSettings = input.readGenericMap();
} else {
this.chunkingSettings = null;
Expand All @@ -89,7 +92,8 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeString(searchInferenceId);
}
out.writeStringArray(sourceFields);
if (out.getTransportVersion().onOrAfter(SEMANTIC_TEXT_CHUNKING_CONFIG)) {
if (out.getTransportVersion().onOrAfter(SEMANTIC_TEXT_CHUNKING_CONFIG)
|| out.getTransportVersion().between(SEMANTIC_TEXT_CHUNKING_CONFIG_8_19, V_9_0_0)) {
out.writeGenericMap(chunkingSettings);
}
}
Expand Down