From 4af07d19e3bcd21dcef901507a77c1454813f05b Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Thu, 5 Dec 2024 13:37:27 +0000 Subject: [PATCH] fix field name for sparse vector query --- .../xpack/inference/mapper/SemanticTextFieldMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapper.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapper.java index 3ee78588de245..da14969f7e08f 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapper.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapper.java @@ -530,7 +530,7 @@ public QueryBuilder semanticQuery(InferenceResults inferenceResults, Integer req } TextExpansionResults textExpansionResults = (TextExpansionResults) inferenceResults; - yield new SparseVectorQueryBuilder(name(), textExpansionResults.getWeightedTokens(), null, null, null, null); + yield new SparseVectorQueryBuilder(inferenceResultsFieldName, textExpansionResults.getWeightedTokens(), null, null, null, null); } case TEXT_EMBEDDING -> { if (inferenceResults instanceof MlTextEmbeddingResults == false) {