Skip to content

Commit 3a919e8

Browse files
feat: updating opensearch-py dependency (#2763)
1 parent f345bb8 commit 3a919e8

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

integrations/opensearch/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ classifiers = [
2424
]
2525
dependencies = [
2626
"haystack-ai>=2.22.0",
27-
"opensearch-py[async]>=2.4.0,<3"
27+
"opensearch-py[async]>=3.0.0"
2828
]
2929

3030
[project.urls]

integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,10 @@ def delete_all_documents(self, recreate_index: bool = False, refresh: bool = Tru
665665
if recreate_index:
666666
# get the current index mappings and settings
667667
index_name = self._index
668+
index_info = self._client.indices.get(index=self._index)
668669
body = {
669-
"mappings": self._client.indices.get(self._index)[index_name]["mappings"],
670-
"settings": self._client.indices.get(self._index)[index_name]["settings"],
670+
"mappings": index_info[index_name]["mappings"],
671+
"settings": index_info[index_name]["settings"],
671672
}
672673
body["settings"]["index"].pop("uuid", None)
673674
body["settings"]["index"].pop("creation_date", None)
@@ -708,7 +709,7 @@ async def delete_all_documents_async(self, recreate_index: bool = False, refresh
708709
if recreate_index:
709710
# get the current index mappings and settings
710711
index_name = self._index
711-
index_info = await self._async_client.indices.get(self._index)
712+
index_info = await self._async_client.indices.get(index=self._index)
712713
body = {
713714
"mappings": index_info[index_name]["mappings"],
714715
"settings": index_info[index_name]["settings"],

0 commit comments

Comments
 (0)