From c8543a36de0c059b01ceb322b1e6501a912288eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Tue, 7 Jan 2025 15:35:38 +0100 Subject: [PATCH] [Obs AI Assistant] Use `sparse_vector` instead of `text_expansion` (#202891) Closes #202313 The [text expansion query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-text-expansion-query.html) was deprecated in 8.15 and is being replaced by [sparse vector query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-sparse-vector-query.html). --- .../recall_from_search_connectors.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/knowledge_base_service/recall_from_search_connectors.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/knowledge_base_service/recall_from_search_connectors.ts index 5abd6d850a8f4..b8a0a7d9267bc 100644 --- a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/knowledge_base_service/recall_from_search_connectors.ts +++ b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/knowledge_base_service/recall_from_search_connectors.ts @@ -155,12 +155,11 @@ async function recallFromLegacyConnectors({ bool: { should: [ { - text_expansion: { - [vectorField]: { - model_text: text, - model_id: modelId, - boost, - }, + sparse_vector: { + field: vectorField, + query: text, + inference_id: modelId, + boost, }, }, ],