跳到内容

Elasticsearch

ElasticsearchIndexStore #

基类: KVIndexStore

Elasticsearch 索引存储。

参数

名称 类型 描述 默认值
elasticsearch_kvstore ElasticsearchKVStore

Elasticsearch 键值存储

必需
namespace str

索引存储的命名空间

源代码位于 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
28
29
30
31
32
33
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,
        collection_suffix: Optional[str] = None,
    ) -> None:
        """Init a ElasticsearchIndexStore."""
        super().__init__(
            elasticsearch_kvstore,
            namespace=namespace,
            collection_suffix=collection_suffix,
        )
        if collection_index:
            self._collection = collection_index
        else:
            self._collection = f"llama_index-index_store.data-{self._namespace}"