From 382fbaca48448caeaddf78f5fc7bed83c52ed90c Mon Sep 17 00:00:00 2001 From: zhaojy01 Date: Wed, 30 Oct 2024 18:11:29 +0800 Subject: [PATCH] Set embedding field as retrievable in Azure Vector Store Resolves #1628 In Azure Vector Store, the embedding field needs to be retrievable for proper functionality. While SearchField class doesn't have a 'retrievable' property, the 'hidden' field serves the same purpose. The fix sets hidden=false on the embedding field to make it retrievable. Link: https://github.com/spring-projects/spring-ai/issues/1628 --- .../springframework/ai/vectorstore/azure/AzureVectorStore.java | 1 + 1 file changed, 1 insertion(+) diff --git a/vector-stores/spring-ai-azure-store/src/main/java/org/springframework/ai/vectorstore/azure/AzureVectorStore.java b/vector-stores/spring-ai-azure-store/src/main/java/org/springframework/ai/vectorstore/azure/AzureVectorStore.java index e5ed2c457..6200738b9 100644 --- a/vector-stores/spring-ai-azure-store/src/main/java/org/springframework/ai/vectorstore/azure/AzureVectorStore.java +++ b/vector-stores/spring-ai-azure-store/src/main/java/org/springframework/ai/vectorstore/azure/AzureVectorStore.java @@ -349,6 +349,7 @@ public class AzureVectorStore extends AbstractObservationVectorStore implements .setSortable(true)); fields.add(new SearchField(EMBEDDING_FIELD_NAME, SearchFieldDataType.collection(SearchFieldDataType.SINGLE)) .setSearchable(true) + .setHidden(false) .setVectorSearchDimensions(dimensions) // This must match a vector search configuration name. .setVectorSearchProfileName(SPRING_AI_VECTOR_PROFILE));