Class MilvusDatabaseKind
java.lang.Object
dev.langchain4j.store.embedding.hibernate.milvus.MilvusDatabaseKind
- All Implemented Interfaces:
DatabaseKind
The database kind for using Milvus.
- See Also:
-
Field Summary
FieldsFields inherited from interface DatabaseKind
COCKROACHDB, DB2, HANA, MARIADB, MSSQL, MYSQL, ORACLE, POSTGRESQL -
Method Summary
Modifier and TypeMethodDescriptioncreateIndexDDL(DistanceFunction distanceFunction, String indexType, String table, String embeddingColumn, String indexOptions) createJdbcUrl(String host, int port, String database) Returns the Milvus session consistency level, so that a search sees all embeddings that this application added or removed before it.booleantableIndexOptions(boolean createIndex, DistanceFunction distanceFunction, String indexType, String table, String embeddingColumn, String indexOptions) Returns the options of the vector index of the collection.
-
Field Details
-
INSTANCE
-
-
Method Details
-
createIndexDDL
public String createIndexDDL(DistanceFunction distanceFunction, String indexType, String table, String embeddingColumn, String indexOptions) - Specified by:
createIndexDDLin interfaceDatabaseKind
-
tableIndexOptions
public String tableIndexOptions(boolean createIndex, DistanceFunction distanceFunction, String indexType, String table, String embeddingColumn, String indexOptions) Returns the options of the vector index of the collection.A Milvus collection always has a vector index, and a search must use the metric of that index. So the metric of the distance function is always returned, also without
createIndex(true). The index type and the index options are only added withcreateIndex(true), like for the relational databases.- Specified by:
tableIndexOptionsin interfaceDatabaseKind- Parameters:
createIndex- whether the builder is configured to create a vector index, seeHibernateEmbeddingStore.BaseBuilder.createIndex(Boolean)distanceFunction- the distance function of the storeindexType- the index type set on the builder, ornulltable- the name of the embedding tableembeddingColumn- the name of the embedding columnindexOptions- the index options set on the builder, ornull- Returns:
- the index options, or
nullto declare no vector index on the table - Throws:
IllegalArgumentException- if Milvus does not support the distance function- See Also:
-
getSetupSql
- Specified by:
getSetupSqlin interfaceDatabaseKind
-
defaultQueryHints
Returns the Milvus session consistency level, so that a search sees all embeddings that this application added or removed before it. Without a consistency level, Milvus uses the default level of the collection, and a search right afteradd(...)can miss the new embeddings.- Specified by:
defaultQueryHintsin interfaceDatabaseKind- Returns:
- the session consistency level as a
HibernateHints.HINT_QUERY_DATABASEhint - See Also:
-
createJdbcUrl
- Specified by:
createJdbcUrlin interfaceDatabaseKind
-
isJdbcUrl
- Specified by:
isJdbcUrlin interfaceDatabaseKind
-