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

Built Distribution

File details

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

File metadata

File hashes

Hashes for llama_index_readers_elasticsearch-0.3.0.tar.gz
Algorithm Hash digest
SHA256 737f17549da0e5768f7ff4a8c1613b1cf1d0320761e1e30169c35afbf272cc5b
MD5 bb45dac34402b0d58cd00b2d17b558b7
BLAKE2b-256 3a81e69fd1aa1c7cd787deca6e51ddaf850a3af2af407685b196f3e738d1e9c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_readers_elasticsearch-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 031ca2a1eed4f1be19814abb70596ec58ebb973d42126398b56a0c8cfe71ced5
MD5 dc5ee79238d9bad5aeb10ef442ab818c
BLAKE2b-256 a3c1a2d8c5d6a6f56fc9a3821bebaf5bffe63d37385632a16933601a8647702c

See more details on using hashes here.

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