Skip to main content
For the complete documentation index for agents and LLMs, see llms.txt.

OpenSearchDocumentStore

The core document store of Haystack Enterprise Platform.


Basic Information​

  • Used with the following retrievers:
    • OpenSearchBM25Retriever
    • OpenSearchEmbeddingRetriever
  • Type: haystack_integrations.document_stores.opensearch.document_store.OpenSearchDocumentStore

Overview​

For details on how this document store works, see OpenSearchDocumentStore in the Haystack documentation.

Authorization​

This is the core document store of Haystack Enterprise Platform and as such, we handle the authorization.

Example Configuration​

In an Index​

To write the preprocesses files into the document store:

  1. Add DocumentWriter to your pipeline.
  2. Add OpenSearchDocumentStore and configure it on the component card.
  3. Connect OpenSearchDocumentStore to DocumentWriter.

In a Query Pipeline​

To retrieve files from the document store:

  1. Add an OpenSearch retriever to your pipeline.
  2. Add OpenSearchDocumentStore and configure it on the component card.
  3. Connect OpenSearchDocumentStore to the retriever.

Example​

When you switch to YAML, you'll see that the document store is an argument of each retriever:

components:
query_expander:
type: haystack.components.query.query_expander.QueryExpander
init_parameters:
n_expansions: 3
include_original_query: true

chat_generator:
type: haystack_integrations.components.generators.anthropic.chat.chat_generator.AnthropicChatGenerator
init_parameters: {}
multi_query_retriever:
type: haystack.components.retrievers.multi_query_text_retriever.MultiQueryTextRetriever
init_parameters:
retriever:
type: haystack_integrations.components.retrievers.opensearch.bm25_retriever.OpenSearchBM25Retriever
init_parameters:
document_store: # this is the document store configuration
type: haystack_integrations.document_stores.opensearch.document_store.OpenSearchDocumentStore
top_k: 5

connections:
- sender: query_expander.queries
receiver: multi_query_retriever.queries

max_runs_per_component: 100

metadata: {}

inputs:
query:
- query_expander.query

Init Parameters​

For a list of parameters you can configure, see OpenSearchDocumentStore API reference in Haystack documentation.