Class MilvusEmbeddingStore.Builder
java.lang.Object
dev.langchain4j.store.embedding.milvus.MilvusEmbeddingStore.Builder
- Enclosing class:
MilvusEmbeddingStore
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionautoFlushOnInsert
(Boolean autoFlushOnInsert) build()
collectionName
(String collectionName) consistencyLevel
(io.milvus.common.clientenum.ConsistencyLevelEnum consistencyLevel) databaseName
(String databaseName) indexType
(io.milvus.param.IndexType indexType) metricType
(io.milvus.param.MetricType metricType) retrieveEmbeddingsOnSearch
(Boolean retrieveEmbeddingsOnSearch)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
host
- Parameters:
host
- The host of the self-managed Milvus instance. Default value: "localhost".- Returns:
- builder
-
port
- Parameters:
port
- The port of the self-managed Milvus instance. Default value: 19530.- Returns:
- builder
-
collectionName
- Parameters:
collectionName
- The name of the Milvus collection. If there is no such collection yet, it will be created automatically. Default value: "default".- Returns:
- builder
-
dimension
- Parameters:
dimension
- The dimension of the embedding vector. (e.g. 384) Mandatory if a new collection should be created.- Returns:
- builder
-
indexType
- Parameters:
indexType
- The type of the index. Default value: FLAT.- Returns:
- builder
-
metricType
- Parameters:
metricType
- The type of the metric used for similarity search. Default value: COSINE.- Returns:
- builder
-
uri
- Parameters:
uri
- The URI of the managed Milvus instance. (e.g. "https://xxx.api.gcp-us-west1.zillizcloud.com")- Returns:
- builder
-
token
- Parameters:
token
- The token (API key) of the managed Milvus instance.- Returns:
- builder
-
username
- Parameters:
username
- The username. See details here.- Returns:
- builder
-
password
- Parameters:
password
- The password. See details here.- Returns:
- builder
-
consistencyLevel
public MilvusEmbeddingStore.Builder consistencyLevel(io.milvus.common.clientenum.ConsistencyLevelEnum consistencyLevel) - Parameters:
consistencyLevel
- The consistency level used by Milvus. Default value: EVENTUALLY.- Returns:
- builder
-
retrieveEmbeddingsOnSearch
- Parameters:
retrieveEmbeddingsOnSearch
- During a similarity search in Milvus (when calling findRelevant()), the embedding itself is not retrieved. To retrieve the embedding, an additional query is required. Setting this parameter to "true" will ensure that embedding is retrieved. Be aware that this will impact the performance of the search. Default value: false.- Returns:
- builder
-
autoFlushOnInsert
- Parameters:
autoFlushOnInsert
- Whether to automatically flush after each insert (add(...)
oraddAll(...)
methods). Default value: false. More info can be found here.- Returns:
- builder
-
databaseName
- Parameters:
databaseName
- Milvus name of database. Default value: null. In this case default Milvus database name will be used.- Returns:
- builder
-
build
-