๐Ÿ†• Haystack 2.11 is out with shorter import time and extended async support. Go to release notes for all highlights ๐ŸŒŸ
Maintained by deepset

Integration: OpenSearch

A Document Store for storing and retrieval from OpenSearch

Authors
Thomas Stadelmann
Julian Risch
deepset

Table of Contents

Overview

PyPI - Version PyPI - Python Version test


Installation

Use pip to install OpenSearch:

pip install opensearch-haystack

Usage

Once installed, initialize your OpenSearch database to use it with Haystack:

from haystack_integrations.document_stores.opensearch import OpenSearchDocumentStore

document_store = OpenSearchDocumentStore()

Writing Documents to OpenSearchDocumentStore

To write documents to OpenSearchDocumentStore, create an indexing pipeline.

from haystack.components.file_converters import TextFileToDocument
from haystack.components.writers import DocumentWriter

indexing = Pipeline()
indexing.add_component("converter", TextFileToDocument())
indexing.add_component("writer", DocumentWriter(document_store))
indexing.connect("converter", "writer")
indexing.run({"converter": {"paths": file_paths}})

License

opensearch-haystack is distributed under the terms of the Apache-2.0 license.