Class HibernateEmbeddingStore.Builder<E>
java.lang.Object
dev.langchain4j.store.embedding.hibernate.HibernateEmbeddingStore.Builder<E>
- Enclosing class:
HibernateEmbeddingStore<E>
-
Method Summary
Modifier and TypeMethodDescriptionbuild()databaseKind(DatabaseKind databaseKind) distanceFunction(DistanceFunction distanceFunction) embeddedTextAttributeName(String embeddedTextAttributeName) embeddingAttributeName(String embeddingAttributeName) metadataAttributeNames(String... metadataAttributeNames) queryHints(Map<String, Object> queryHints) Sets query hints that are applied to every similarity search (search(...)andquery(...)).sessionFactory(org.hibernate.SessionFactory sessionFactory) toString()unmappedMetadataAttributeName(String unmappedMetadataAttributeName)
-
Method Details
-
embeddingAttributeName
-
embeddedTextAttributeName
public HibernateEmbeddingStore.Builder<E> embeddedTextAttributeName(String embeddedTextAttributeName) -
unmappedMetadataAttributeName
public HibernateEmbeddingStore.Builder<E> unmappedMetadataAttributeName(String unmappedMetadataAttributeName) -
metadataAttributeNames
-
sessionFactory
public HibernateEmbeddingStore.Builder<E> sessionFactory(org.hibernate.SessionFactory sessionFactory) -
databaseKind
-
distanceFunction
-
queryHints
Sets query hints that are applied to every similarity search (search(...)andquery(...)). They are not applied when embeddings are added or removed.Each entry is passed to Hibernate's
SelectionQuery.setHint(String, Object). The value ofHibernateHints.HINT_QUERY_DATABASEis written into the generated query, so it is specific to one database. To pass more than one such database hint, use aCollectionofStrings as the value.A database kind can add default hints, see
DatabaseKind.defaultQueryHints(). A hint set here replaces the default hint with the same name. For example, a Milvus search uses the session consistency level by default, so it sees the embeddings that this application added just before it. To also see the embeddings that other applications added just before it, use the strong consistency level:.queryHints(Map.of(HibernateHints.HINT_QUERY_DATABASE, MilvusDatabaseHints.CONSISTENCY_LEVEL + "=STRONG"))- Parameters:
queryHints- the query hints, ornullfor only the default hints of the database kind- Returns:
- this builder
-
build
-
toString
-