Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenSearchDocumentStore.delete_index breaks if index does not exist #4292

Closed
1 task done
tstadel opened this issue Feb 28, 2023 · 0 comments · Fixed by #4295
Closed
1 task done

OpenSearchDocumentStore.delete_index breaks if index does not exist #4292

tstadel opened this issue Feb 28, 2023 · 0 comments · Fixed by #4295
Labels
topic:opensearch type:bug Something isn't working type:documentation Improvements on the docs

Comments

@tstadel
Copy link
Member

tstadel commented Feb 28, 2023

Describe the bug
OpenSearchDocumentStore.delete_index breaks if index does not exist.
Usually delete_index does not raise when index does not exist. With newly introduced IVF feature this has changed.

Error message

Traceback (most recent call last):
   ...
    document_store.delete_index(index=document_store.index)
  File "/opt/venv/lib/python3.10/site-packages/haystack/document_stores/opensearch.py", line 748, in delete_index
    index_mapping = self.client.indices.get(index)[index]["mappings"]["properties"]
  File "/opt/venv/lib/python3.10/site-packages/opensearchpy/client/utils.py", line 178, in _wrapped
    return func(*args, params=params, headers=headers, **kwargs)
  File "/opt/venv/lib/python3.10/site-packages/opensearchpy/client/indices.py", line 197, in get
    return self.transport.perform_request(
  File "/opt/venv/lib/python3.10/site-packages/opensearchpy/transport.py", line 408, in perform_request
    raise e
  File "/opt/venv/lib/python3.10/site-packages/opensearchpy/transport.py", line 369, in perform_request
    status, headers_response, data = connection.perform_request(
  File "/opt/venv/lib/python3.10/site-packages/opensearchpy/connection/http_urllib3.py", line 266, in perform_request
    self._raise_error(
  File "/opt/venv/lib/python3.10/site-packages/opensearchpy/connection/base.py", line 301, in _raise_error
    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(
opensearchpy.exceptions.NotFoundError: NotFoundError(404, 'index_not_found_exception', 'no such index [...]', ..., index_or_alias)

Expected behavior
delete_index does not raise if index does not exist.

To Reproduce
Call delete_index on OpenSearchDocumentStore for non existing index

FAQ Check

System:

  • OS:
  • GPU/CPU:
  • Haystack version (commit or version number): 1.14.0
  • DocumentStore:
  • Reader:
  • Retriever:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:opensearch type:bug Something isn't working type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants