def remove(self, doc_type, doc_ids, **kwargs):
try:<EOL><INDENT>actions = []<EOL>for doc_id in doc_ids:<EOL><INDENT>log.debug("<STR_LIT>", doc_type, doc_id)<EOL>action = {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>"<STR_LIT>": self.index_name,<EOL>"<STR_LIT>": doc_type,<EOL>"<STR_LIT>": doc_id<EOL>}<EOL>actions.append(action)<EOL><DEDENT>bulk(self._es, actions, **kwargs)<EOL><DEDENT>except BulkIndexError as ex:<EOL><INDENT>valid_errors = [error for error in ex.errors if error['<STR_LIT>']['<STR_LIT:status>'] != <NUM_LIT>]<EOL>if valid_errors:<EOL><INDENT>log.exception("<STR_LIT>")<EOL>raise<EOL><DEDENT><DEDENT>
Implements call to remove the documents from the index