Skip to main content

llama-index readers opensearch integration

Project description

Opensearch Loader

The Opensearch Loader returns a set of texts corresponding to documents retrieved from an Opensearch index. The user initializes the loader with an Opensearch index. They then pass in a field, and optionally a JSON query DSL object to fetch the fields they want.

Usage

Here's an example usage of the OpensearchReader to load 100 documents.

from llama_index import download_loader

OpensearchReader = download_loader("OpensearchReader")

reader = OpensearchReader(
    host="localhost",
    port=9200,
    index="<index_name>",
    basic_auth=("<user_name>", "<password>"),
)

query = {"size": 100, "query": {"match_all": {}}}
documents = reader.load_data(
    "<field_name>", query=query, embedding_field="field_name"
)

This loader is designed to be used as a way to load data into LlamaIndex and/or subsequently used as a Tool in a LangChain Agent. See here for examples.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_readers_opensearch-0.1.3.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page