Class ElasticsearchConfigurationHybrid
java.lang.Object
dev.langchain4j.store.embedding.elasticsearch.ElasticsearchConfigurationHybrid
- All Implemented Interfaces:
ElasticsearchConfiguration
Represents an Elasticsearch index as an embedding store
using rff to combine a kNN query and a full text search.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface ElasticsearchConfiguration
TEXT_FIELD, VECTOR_FIELD -
Method Summary
Modifier and TypeMethodDescriptionbuilder()co.elastic.clients.elasticsearch.core.SearchResponse<Document> hybridSearch(co.elastic.clients.elasticsearch.ElasticsearchClient client, String indexName, EmbeddingSearchRequest embeddingSearchRequest, String textQuery) Used for hybrid searchbooleanTemporary method which returns if we should return the Vector in the responseMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ElasticsearchConfiguration
fullTextSearch, vectorSearch
-
Method Details
-
builder
-
isIncludeVectorResponse
public boolean isIncludeVectorResponse()Description copied from interface:ElasticsearchConfigurationTemporary method which returns if we should return the Vector in the response- Specified by:
isIncludeVectorResponsein interfaceElasticsearchConfiguration- Returns:
- true or false
-
hybridSearch
public co.elastic.clients.elasticsearch.core.SearchResponse<Document> hybridSearch(co.elastic.clients.elasticsearch.ElasticsearchClient client, String indexName, EmbeddingSearchRequest embeddingSearchRequest, String textQuery) throws co.elastic.clients.elasticsearch._types.ElasticsearchException, IOException Description copied from interface:ElasticsearchConfigurationUsed for hybrid search- Specified by:
hybridSearchin interfaceElasticsearchConfiguration- Parameters:
client- The Elasticsearch clientindexName- The index nameembeddingSearchRequest- The embedding search requesttextQuery- The text query- Returns:
- The search response
- Throws:
co.elastic.clients.elasticsearch._types.ElasticsearchException- if an error occurs during the searchIOException- if an I/O error occurs
-