@classmethod
    def index(cls, document, id_=None, overwrite_existing=True, es=None,
              index=None):
        if es is None:
            es = cls.get_es()

        if index is None:
            index = cls.get_index()

        kw = {}
        if not overwrite_existing:
            kw['op_type'] = 'create'
        es.index(index=index, doc_type=cls.get_mapping_type_name(),
                 body=document, id=id_, **kw)
Adds or updates a document to the index
dataset/ETHPy150Open mozilla/elasticutils/elasticutils/__init__.py/Indexable.index