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.3.1.tar.gz (3.6 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.3.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_elasticsearch-0.3.1.tar.gz
Algorithm Hash digest
SHA256 ba806ad1f3220c3988b5cb074471ab723db3ca351bcbff6fa4b788745d2021a4
MD5 b490565d3819587f4ec575e5f0f7100b
BLAKE2b-256 3a2f2d9fa0772d4af29c977110dd162cc5bc5fa41c22208a9e5be06fb2e27643

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_readers_elasticsearch-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 394def23c9f37733e9d0ad98d8d2dc4e4a06a12e5b58d8be56d79f052dc3cd25
MD5 a9f286f270793587a5ea5ac9213409cb
BLAKE2b-256 4432ea35a6868477cc1d3f2ad38a6eb993ffe1535cf1a3e140f0f716d8e9c194

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