Skip to content

Commit 0822c91

Browse files
waileongilayaperumalg
authored andcommitted
Added configuration options for database, collection names, embedding dimensions, index and metric types, and field names in the MilvusVectorStoreAutoConfiguration.
- Configuration options like `databaseName`, `collectionName`, `embeddingDimension`, `indexType`, and `metricType` were added. - Additional parameters including `indexParameters`, `iDFieldName`, `contentFieldName`, `metadataFieldName`, and `embeddingFieldName` were incorporated into the builder method. Signed-off-by: waileong <[email protected]> Apply spring-javaformat Signed-off-by: waileong <[email protected]>
1 parent 07c2b9d commit 0822c91

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/vectorstore/milvus/MilvusVectorStoreAutoConfiguration.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import io.milvus.client.MilvusServiceClient;
2323
import io.milvus.param.ConnectParam;
2424

25+
import io.milvus.param.IndexType;
26+
import io.milvus.param.MetricType;
2527
import org.springframework.ai.embedding.BatchingStrategy;
2628
import org.springframework.ai.embedding.EmbeddingModel;
2729
import org.springframework.ai.embedding.TokenCountBatchingStrategy;
@@ -70,6 +72,17 @@ public MilvusVectorStore vectorStore(MilvusServiceClient milvusClient, Embedding
7072

7173
return MilvusVectorStore.builder(milvusClient, embeddingModel)
7274
.initializeSchema(properties.isInitializeSchema())
75+
.databaseName(properties.getDatabaseName())
76+
.collectionName(properties.getCollectionName())
77+
.embeddingDimension(properties.getEmbeddingDimension())
78+
.indexType(IndexType.valueOf(properties.getIndexType().name()))
79+
.metricType(MetricType.valueOf(properties.getMetricType().name()))
80+
.indexParameters(properties.getIndexParameters())
81+
.iDFieldName(properties.getIdFieldName())
82+
.autoId(properties.isAutoId())
83+
.contentFieldName(properties.getContentFieldName())
84+
.metadataFieldName(properties.getMetadataFieldName())
85+
.embeddingFieldName(properties.getEmbeddingFieldName())
7386
.batchingStrategy(batchingStrategy)
7487
.observationRegistry(observationRegistry.getIfUnique(() -> ObservationRegistry.NOOP))
7588
.customObservationConvention(customObservationConvention.getIfAvailable(() -> null))

0 commit comments

Comments
 (0)