<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def delete_all(self):
        '''Delete all books from the index'''
        def delete_action_gen():
            scanner = scan(self.es,
                           index=self.index_name,
                           query={'query': {'match_all':{}}})
            for v in scanner:
                yield { '_op_type': 'delete',
                        '_index': self.index_name,
                        '_type': v['_type'],
                        '_id': v['_id'],
                      }
        bulk(self.es, delete_action_gen())