diff --git a/sausage/esoperations.py b/sausage/esoperations.py
index 82eb6b3..8492a91 100644
--- a/sausage/esoperations.py
+++ b/sausage/esoperations.py
@@ -1,23 +1,23 @@
 # © All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE,
 # Switzerland
 # SCITAS - Scientific IT and Application Support, 2021
 # See the LICENSE.txt file for more details.
 
 import importlib
-for mname in "elasticsearch elasticsearch6":
+for mname in ['elasticsearch', 'elasticsearch6']:
     es_spec = importlib.util.find_spec(mname)
     if es_spec is not None:
-        from mname import Elasticsearch
+        esmodule = importlib.import_module(mname)
         break
 
 
 class ESOp:
     def __init__(self, server):
-        self.server = Elasticsearch([server])
+        self.server = esmodule.Elasticsearch([server])
 
     def esget(self, index, doc):
         try:
             response = self.server.search(index=index, body=doc)
             return response
         except BaseException:
             return ""