From c01beee1fab7c0de22869ce74f34ebd1f1d54722 Mon Sep 17 00:00:00 2001
From: Yong woo Song <ywsong.dev@kakao.com>
Date: Wed, 10 Apr 2024 03:35:05 +0900
Subject: [PATCH] fix: elasticsearch indexstore for collection name to index
 (#12672)

---
 .../llama_index/storage/index_store/elasticsearch/base.py    | 5 +++++
 .../pyproject.toml                                           | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/llama-index-integrations/storage/index_store/llama-index-storage-index-store-elasticsearch/llama_index/storage/index_store/elasticsearch/base.py b/llama-index-integrations/storage/index_store/llama-index-storage-index-store-elasticsearch/llama_index/storage/index_store/elasticsearch/base.py
index 43b4075a7..d631a0dbf 100644
--- a/llama-index-integrations/storage/index_store/llama-index-storage-index-store-elasticsearch/llama_index/storage/index_store/elasticsearch/base.py
+++ b/llama-index-integrations/storage/index_store/llama-index-storage-index-store-elasticsearch/llama_index/storage/index_store/elasticsearch/base.py
@@ -16,7 +16,12 @@ class ElasticsearchIndexStore(KVIndexStore):
     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}"
diff --git a/llama-index-integrations/storage/index_store/llama-index-storage-index-store-elasticsearch/pyproject.toml b/llama-index-integrations/storage/index_store/llama-index-storage-index-store-elasticsearch/pyproject.toml
index 34bc54172..f7d4af889 100644
--- a/llama-index-integrations/storage/index_store/llama-index-storage-index-store-elasticsearch/pyproject.toml
+++ b/llama-index-integrations/storage/index_store/llama-index-storage-index-store-elasticsearch/pyproject.toml
@@ -27,7 +27,7 @@ exclude = ["**/BUILD"]
 license = "MIT"
 name = "llama-index-storage-index-store-elasticsearch"
 readme = "README.md"
-version = "0.1.2"
+version = "0.1.3"
 
 [tool.poetry.dependencies]
 python = ">=3.8.1,<4.0"
-- 
GitLab