diff --git a/ccplugin.py b/ccplugin.py
index 4674c8a25531d94c845ecd43806cbf61188c27e3_Y2NwbHVnaW4ucHk=..a0e41f6bd19bd43783c641dadf85b42c84d9ab28_Y2NwbHVnaW4ucHk= 100644
--- a/ccplugin.py
+++ b/ccplugin.py
@@ -68,7 +68,10 @@
                         json = serializer.serialize()
                         # TODO remove non indexable data or (better) serialize only
                         if not self.config.dry_run:
-                            es.index(index=index_name, doc_type=etype, body=json)
+                            es.index(index=index_name,
+                                     id=entity.eid,
+                                     doc_type=etype,
+                                     body=json)
                         # TODO optimize with elasticsearch.helpers.bulk
                         # or elasticsearch.helpers.parallel_bulk
                         # or elasticsearch.helpers.streaming_bulk
diff --git a/hooks.py b/hooks.py
index 4674c8a25531d94c845ecd43806cbf61188c27e3_aG9va3MucHk=..a0e41f6bd19bd43783c641dadf85b42c84d9ab28_aG9va3MucHk= 100644
--- a/hooks.py
+++ b/hooks.py
@@ -53,6 +53,7 @@
             try:
                 # TODO option pour coté async ?
                 es.index(index=index_name,
+                         id=self.entity.eid,
                          doc_type=self.entity.cw_etype,
                          body=json)
             except (ConnectionError, ProtocolError):