Class ElasticsearchContentRetriever

java.lang.Object
dev.langchain4j.store.embedding.elasticsearch.AbstractElasticsearchEmbeddingStore
dev.langchain4j.rag.content.retriever.elasticsearch.ElasticsearchContentRetriever
All Implemented Interfaces:
ContentRetriever, EmbeddingStore<TextSegment>

  • Constructor Details

    • ElasticsearchContentRetriever

      public ElasticsearchContentRetriever(ElasticsearchConfiguration configuration, org.elasticsearch.client.RestClient restClient, String indexName, EmbeddingModel embeddingModel, int maxResults, double minScore, Filter filter)
      Creates an instance of ElasticsearchContentRetriever using a RestClient.
      Parameters:
      configuration - Elasticsearch retriever configuration to use (knn, script, full text, hybrid, hybrid with reranker)
      restClient - Elasticsearch Rest Client (mandatory)
      indexName - Elasticsearch index name (optional). Default value: "default". Index will be created automatically if not exists.
      embeddingModel - Embedding model to be used by the retriever
      maxResults - Maximum number of results to retrieve
      minScore - Minimum score threshold for retrieved results
      filter - Filter to apply during retrieval
  • Method Details