|
22 | 22 | import io.milvus.client.MilvusServiceClient; |
23 | 23 | import io.milvus.param.ConnectParam; |
24 | 24 |
|
| 25 | +import io.milvus.param.IndexType; |
| 26 | +import io.milvus.param.MetricType; |
25 | 27 | import org.springframework.ai.embedding.BatchingStrategy; |
26 | 28 | import org.springframework.ai.embedding.EmbeddingModel; |
27 | 29 | import org.springframework.ai.embedding.TokenCountBatchingStrategy; |
@@ -69,11 +71,22 @@ public MilvusVectorStore vectorStore(MilvusServiceClient milvusClient, Embedding |
69 | 71 | ObjectProvider<VectorStoreObservationConvention> customObservationConvention) { |
70 | 72 |
|
71 | 73 | return MilvusVectorStore.builder(milvusClient, embeddingModel) |
72 | | - .initializeSchema(properties.isInitializeSchema()) |
73 | | - .batchingStrategy(batchingStrategy) |
74 | | - .observationRegistry(observationRegistry.getIfUnique(() -> ObservationRegistry.NOOP)) |
75 | | - .customObservationConvention(customObservationConvention.getIfAvailable(() -> null)) |
76 | | - .build(); |
| 74 | + .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()) |
| 86 | + .batchingStrategy(batchingStrategy) |
| 87 | + .observationRegistry(observationRegistry.getIfUnique(() -> ObservationRegistry.NOOP)) |
| 88 | + .customObservationConvention(customObservationConvention.getIfAvailable(() -> null)) |
| 89 | + .build(); |
77 | 90 | } |
78 | 91 |
|
79 | 92 | @Bean |
|
0 commit comments