Skip to main content

llama-index readers elasticsearch integration

Project description

LlamaIndex Readers Integration: Elasticsearch

Overview

Elasticsearch (or Opensearch) Reader over REST API is a tool designed to read documents from an Elasticsearch or Opensearch index using the basic search API. These documents can then be utilized in downstream LlamaIndex data structures.

Installation

You can install Elasticsearch (or Opensearch) Reader via pip:

pip install llama-index-readers-elasticsearch

Usage

from llama_index.core.schema import Document
from llama_index.readers.elasticsearch import ElasticsearchReader

# Initialize ElasticsearchReader
reader = ElasticsearchReader(
    endpoint="<Your Elasticsearch/Opensearch Endpoint>",
    index="<Index Name>",
    httpx_client_args={
        "timeout": 10
    },  # Optional additional arguments for the httpx.Client
)

# Load data from Elasticsearch
documents = reader.load_data(
    field="<Field Name>",  # Field in the document to retrieve text from
    query={"query": {"match_all": {}}},  # Elasticsearch JSON query DSL object
    embedding_field="<Embedding Field>",  # Field for embeddings (optional)
)

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.

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_elasticsearch-0.4.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_readers_elasticsearch-0.4.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_elasticsearch-0.4.0.tar.gz
Algorithm Hash digest
SHA256 0d5e412be849d34421738f52381c1d1f12fe4ebda9bedea12810d91968ce243d
MD5 258d5d1a8fe538bdb6c851aa4a1ceb77
BLAKE2b-256 af80515f5119b6e967cec9cdbfee455c01f3c1de8e2b9731258c99fb52fada0f

See more details on using hashes here.

File details

Details for the file llama_index_readers_elasticsearch-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_elasticsearch-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1192b42d12a36985bd41061212077769e6c54f84e7b185ce64b587bd2a710b43
MD5 d8b0fcebba254a9bb81ca3a40a3f26b0
BLAKE2b-256 c758a348834b65d4c84986b75c45be4760f4cf644de809ea9f414f0d23e66006

See more details on using hashes here.

Supported by

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