def set_bookmark(self):
def _success_date():<EOL><INDENT>bookmark = {<EOL>'<STR_LIT:date>': self.new_bookmark or datetime.datetime.utcnow().<EOL>strftime(self.doc_id_suffix)<EOL>}<EOL>yield dict(_index=self.last_index_written,<EOL>_type=self.bookmark_doc_type,<EOL>_source=bookmark)<EOL><DEDENT>if self.last_index_written:<EOL><INDENT>bulk(self.client,<EOL>_success_date(),<EOL>stats_only=True)<EOL><DEDENT>
Set bookmark for starting next aggregation.