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.1.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.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_elasticsearch-0.4.1.tar.gz
Algorithm Hash digest
SHA256 5643b01ccde9ba0975f56ee4c41a08e4280a9c3ae3c9d2dee97dc281e358eb91
MD5 c94b158f51980f0f724d3f46b96c8c8a
BLAKE2b-256 e4ceddc1497cc2ef7cd4648918cf3a5ba636c1ced88efd9f52492dcfe8a3900b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_readers_elasticsearch-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 212e7142eca3f2b2a5c6b5d40e16f669db562c6e2ad7fc0be4c591749937ca3e
MD5 d0a18704bd305c86595882df282157ed
BLAKE2b-256 f23a189f07cd442bc85b6820c03b98a5040a5e27158bcc7508e7d548060999cb

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