From 3b8970cf12484d5c1ea3e484e60c34e083887988 Mon Sep 17 00:00:00 2001 From: Pat Whelan Date: Wed, 31 Jul 2024 13:26:55 -0400 Subject: [PATCH] [ML] Return both modelId and inferenceId (#111490) Temporarily return both `modelId` and `inferenceId` for GET /_inference until we migrate clients to only `inferenceId`. --- docs/changelog/111490.yaml | 5 +++++ .../org/elasticsearch/inference/ModelConfigurations.java | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 docs/changelog/111490.yaml diff --git a/docs/changelog/111490.yaml b/docs/changelog/111490.yaml new file mode 100644 index 0000000000000..b67c16189cc62 --- /dev/null +++ b/docs/changelog/111490.yaml @@ -0,0 +1,5 @@ +pr: 111490 +summary: Temporarily return both `modelId` and `inferenceId` for GET /_inference until we migrate clients to only `inferenceId` +area: Machine Learning +type: bug +issues: [] diff --git a/server/src/main/java/org/elasticsearch/inference/ModelConfigurations.java b/server/src/main/java/org/elasticsearch/inference/ModelConfigurations.java index 0df0378c4a5f4..ce83a7c1b6c79 100644 --- a/server/src/main/java/org/elasticsearch/inference/ModelConfigurations.java +++ b/server/src/main/java/org/elasticsearch/inference/ModelConfigurations.java @@ -126,6 +126,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws if (params.paramAsBoolean(USE_ID_FOR_INDEX, false)) { builder.field(INDEX_ONLY_ID_FIELD_NAME, inferenceEntityId); } else { + builder.field(INDEX_ONLY_ID_FIELD_NAME, inferenceEntityId); builder.field(INFERENCE_ID_FIELD_NAME, inferenceEntityId); } builder.field(TaskType.NAME, taskType.toString()); @@ -142,6 +143,7 @@ public XContentBuilder toFilteredXContent(XContentBuilder builder, Params params if (params.paramAsBoolean(USE_ID_FOR_INDEX, false)) { builder.field(INDEX_ONLY_ID_FIELD_NAME, inferenceEntityId); } else { + builder.field(INDEX_ONLY_ID_FIELD_NAME, inferenceEntityId); builder.field(INFERENCE_ID_FIELD_NAME, inferenceEntityId); } builder.field(TaskType.NAME, taskType.toString());