<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_doc_from_index(index_writer, docid):
 """ Remove a document from the index """

        query = whoosh.query.Term("docid", docid)
        index_writer.delete_by_query(query)