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
This commit is contained in:
zhaojy01
2024-10-30 18:11:29 +08:00
committed by Soby Chacko
parent a2e2696c04
commit 382fbaca48

View File

@@ -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));