Class MilvusEmbeddingStore.Builder
java.lang.Object
dev.langchain4j.store.embedding.milvus.MilvusEmbeddingStore.Builder
- Enclosing class:
MilvusEmbeddingStore
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionautoFlushOnInsert
(Boolean autoFlushOnInsert) build()
collectionName
(String collectionName) consistencyLevel
(io.milvus.common.clientenum.ConsistencyLevelEnum consistencyLevel) databaseName
(String databaseName) idFieldName
(String idFieldName) indexType
(io.milvus.param.IndexType indexType) metadataFieldName
(String metadataFieldName) metricType
(io.milvus.param.MetricType metricType) milvusClient
(io.milvus.client.MilvusServiceClient milvusClient) retrieveEmbeddingsOnSearch
(Boolean retrieveEmbeddingsOnSearch) textFieldName
(String textFieldName) vectorFieldName
(String vectorFieldName)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
milvusClient
-
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
-
idFieldName
- Parameters:
idFieldName
- the name of the field where the ID of theEmbedding
is stored. Default value: "id".- Returns:
- builder
-
textFieldName
- Parameters:
textFieldName
- the name of the field where the text of theTextSegment
is stored. Default value: "text".- Returns:
- builder
-
metadataFieldName
- Parameters:
metadataFieldName
- the name of the field where theMetadata
of theTextSegment
is stored. Default value: "metadata".- Returns:
- builder
-
vectorFieldName
- Parameters:
vectorFieldName
- the name of the field where theEmbedding
is stored. Default value: "vector".- Returns:
- builder
-
build
-