Class ElasticsearchConfigurationScript
java.lang.Object
dev.langchain4j.store.embedding.elasticsearch.ElasticsearchConfigurationScript
- All Implemented Interfaces:
ElasticsearchConfiguration
Represents an Elasticsearch index as an embedding store.
Current implementation assumes the index uses the cosine distance metric.
Supports storing
Supports storing
Metadata and filtering by it using Filter
(provided inside EmbeddingSearchRequest).- 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, 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, 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
-