Skip to content

Elasticsearch

ElasticsearchIndexStore #

Bases: KVIndexStore

Elasticsearch Index store.

Parameters:

Name Type Description Default
elasticsearch_kvstore ElasticsearchKVStore

Elasticsearch key-value store

required
namespace str

namespace for the index store

None
Source code in llama-index-integrations/storage/index_store/llama-index-storage-index-store-elasticsearch/llama_index/storage/index_store/elasticsearch/base.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class ElasticsearchIndexStore(KVIndexStore):
    """Elasticsearch Index store.

    Args:
        elasticsearch_kvstore (ElasticsearchKVStore): Elasticsearch key-value store
        namespace (str): namespace for the index store

    """

    def __init__(
        self,
        elasticsearch_kvstore: ElasticsearchKVStore,
        collection_index: Optional[str] = None,
        namespace: Optional[str] = None,
    ) -> None:
        """Init a ElasticsearchIndexStore."""
        super().__init__(elasticsearch_kvstore, namespace=namespace)
        if collection_index:
            self._collection = collection_index
        else:
            self._collection = f"llama_index-index_store.data-{self._namespace}"