def _pre_delete_hook(cls, key):
        """
        Removes instance from index.
        """
        if cls.searching_enabled:
            doc_id = cls.search_get_document_id(key)
            index = cls.search_get_index()
            index.delete(doc_id)