Skip to content

Commit

Permalink
Allows elasticsearch7' package to be used instead of elasticsearch'.
Browse files Browse the repository at this point in the history
  • Loading branch information
weimzh committed Apr 15, 2024
1 parent 1a82f23 commit cfe4c77
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions appbuilder/core/components/retriever/bes/bes_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,13 @@ def _lazy_import_es(self):
self._es = Elasticsearch
self._helpers = helpers
except ImportError:
raise ImportError("Elasticsearch module is not installed. "
"Please install it using 'pip install elasticsearch==7.11.0'.")
try:
from elasticsearch7 import Elasticsearch, helpers
self._es = Elasticsearch
self._helpers = helpers
except ImportError:
raise ImportError("Elasticsearch module is not installed. "
"Please install it using 'pip install elasticsearch==7.11.0'.")

@staticmethod
def generate_id(length=16):
Expand Down

0 comments on commit cfe4c77

Please sign in to comment.