diff --git a/application/libs/flask_elasticsearch/elasticsearch.py b/application/libs/flask_elasticsearch/elasticsearch.py
index 9888a32f4bc3aeb7f222baedb8269e7caf42c2e0..56874fbb26487a274c0853b6dae769eccac884ae 100644
--- a/application/libs/flask_elasticsearch/elasticsearch.py
+++ b/application/libs/flask_elasticsearch/elasticsearch.py
@@ -21,11 +21,20 @@ from application.common import ConfigHelper
 
 class FlaskElasticsearch:
     def __init__(self, app=None):
+        """
+        Initialize a FlaskElasticsearch instance.
+
+        :param app: Flask application instance for Elasticsearch initialization.
+        """
         if app is not None:
             self.init_app(app)
 
     def init_app(self, app: Flask) -> None:
-        """Initialize the app"""
+        """
+        Initialize the app with Elasticsearch connection.
+
+        :param app: Flask application instance for Elasticsearch initialization.
+        """
         if hasattr(app, 'teardown_appcontext'):
             app.teardown_appcontext(self.teardown)
         else:
@@ -33,7 +42,11 @@ class FlaskElasticsearch:
 
     @staticmethod
     def teardown(exception):
-        """Clears the Elasticsearch connection after each request."""
+        """
+        Clear the Elasticsearch connection after each request.
+
+        :param exception: Exception instance, if any.
+        """
         ctx = current_app._get_current_object()
         if hasattr(ctx, 'elasticsearch'):
             ctx.elasticsearch = None
@@ -41,7 +54,12 @@ class FlaskElasticsearch:
             raise RuntimeError(exception)
 
     def __getattr__(self, item: Any) -> Any:
-        """Lazy initialization of Elasticsearch connection on first use."""
+        """
+        Lazy initialization of Elasticsearch connection on first use.
+
+        :param item: Attribute to get from the Elasticsearch connection.
+        :return: Value of the requested attribute.
+        """
         ctx = current_app._get_current_object()
         if ctx is not None:
             if not hasattr(ctx, 'elasticsearch'):
@@ -61,9 +79,6 @@ class FlaskElasticsearch:
             if current_app:
                 config_helper = ConfigHelper(current_app)
                 cfg = config_helper.Elasticsearch
-                if cfg is None:
-                    raise KeyError('Key Elasticsearch is not defined')
-
                 host = cfg.Host or 'localhost'
                 port = int(cfg.Port) or 9200
                 user = cfg.User or None