From 5a90beebac1fc7cd5002869a814f2b904f0eadb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=B3=A2?= Date: Thu, 31 Oct 2024 09:58:31 +0800 Subject: [PATCH] fix(milvus): doSimilaritySearch to use the databaseName - The doSimilaritySearch method did not pass the databaseName parameter in milvus 2.3.4 and before, resulting in the use of the default database; The current milvus upgrade to 2.3.5 supports passing the databaseName parameter - Update doSimilaritySearch to set the database name from the Milvus configuration --- .../org/springframework/ai/vectorstore/MilvusVectorStore.java | 1 + 1 file changed, 1 insertion(+) diff --git a/vector-stores/spring-ai-milvus-store/src/main/java/org/springframework/ai/vectorstore/MilvusVectorStore.java b/vector-stores/spring-ai-milvus-store/src/main/java/org/springframework/ai/vectorstore/MilvusVectorStore.java index 55a6cfaa9c..9200131092 100644 --- a/vector-stores/spring-ai-milvus-store/src/main/java/org/springframework/ai/vectorstore/MilvusVectorStore.java +++ b/vector-stores/spring-ai-milvus-store/src/main/java/org/springframework/ai/vectorstore/MilvusVectorStore.java @@ -224,6 +224,7 @@ public List doSimilaritySearch(SearchRequest request) { float[] embedding = this.embeddingModel.embed(request.getQuery()); var searchParamBuilder = SearchParam.newBuilder() + .withDatabaseName(this.config.databaseName) .withCollectionName(this.config.collectionName) .withConsistencyLevel(ConsistencyLevelEnum.STRONG) .withMetricType(this.config.metricType)