def replace_one ( self , replacement ) : self . __bulk . add_replace ( self . __selector , replacement , upsert = True , collation = self . __collation )
elasticsearch python bulk upsert
Replace one entire document matching the selector criteria .
def replace_one(self, replacement):
        """Replace one entire document matching the selector criteria.

        :Parameters:
          - `replacement` (dict): the replacement document
        """
        self.__bulk.add_replace(self.__selector, replacement, upsert=True,
                                collation=self.__collation)