def METHOD_NAME(html_objs_qs, wipe=False):
    """
    Helper function for reindexing and wiping indexes of projects and versions.
    If ``wipe`` is set to False, html_objs are deleted from the ES index,
    else, html_objs are indexed.
    """
    from readthedocs.search.documents import PageDocument
    from readthedocs.search.tasks import delete_objects_in_es, index_objects_to_es
    if html_objs_qs:
        obj_ids = []
        for html_objs in html_objs_qs:
            obj_ids.extend([obj.id for obj in html_objs])
        # removing redundant ids if exists.
        obj_ids = list(set(obj_ids))
        if obj_ids:
            kwargs = {
                "app_label": HTMLFile._meta.app_label,
                "model_name": HTMLFile.__name__,
                "document_class": str(PageDocument),
                "objects_id": obj_ids,
            }
            if not wipe:
                index_objects_to_es.delay(**kwargs)
            else:
                delete_objects_in_es.delay(**kwargs)