Class ElasticsearchConfigurationKnn
java.lang.Object
dev.langchain4j.store.embedding.elasticsearch.ElasticsearchConfigurationKnn
- All Implemented Interfaces:
ElasticsearchConfiguration
Represents an Elasticsearch index as an embedding store
using the approximate kNN query implementation.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface ElasticsearchConfiguration
TEXT_FIELD, VECTOR_FIELD -
Method Summary
Modifier and TypeMethodDescriptionbuilder()booleanTemporary method which returns if we should return the Vector in the responseco.elastic.clients.elasticsearch.core.SearchResponse<Document> vectorSearch(co.elastic.clients.elasticsearch.ElasticsearchClient client, String indexName, dev.langchain4j.store.embedding.EmbeddingSearchRequest embeddingSearchRequest) Used for vector searchMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ElasticsearchConfiguration
fullTextSearch, hybridSearch
-
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
-
vectorSearch
public co.elastic.clients.elasticsearch.core.SearchResponse<Document> vectorSearch(co.elastic.clients.elasticsearch.ElasticsearchClient client, String indexName, dev.langchain4j.store.embedding.EmbeddingSearchRequest embeddingSearchRequest) throws co.elastic.clients.elasticsearch._types.ElasticsearchException, IOException Description copied from interface:ElasticsearchConfigurationUsed for vector search- Specified by:
vectorSearchin interfaceElasticsearchConfiguration- Parameters:
client- The Elasticsearch clientindexName- The index nameembeddingSearchRequest- The embedding search request- Returns:
- The search response
- Throws:
co.elastic.clients.elasticsearch._types.ElasticsearchException- if an error occurs during the searchIOException- if an I/O error occurs
-