Skip to content

Elasticsearch

ElasticsearchIndexStore #

Bases: KVIndexStore

Elasticsearch索引存储。

Parameters:

Name Type Description Default
elasticsearch_kvstore ElasticsearchKVStore

Elasticsearch键值存储

required
namespace str

索引存储的命名空间

None
Source code in 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
class ElasticsearchIndexStore(KVIndexStore):
    """Elasticsearch索引存储。

    Args:
        elasticsearch_kvstore (ElasticsearchKVStore): Elasticsearch键值存储
        namespace (str): 索引存储的命名空间"""

    def __init__(
        self,
        elasticsearch_kvstore: ElasticsearchKVStore,
        collection_index: Optional[str] = None,
        namespace: Optional[str] = None,
    ) -> None:
        """初始化一个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}"