def METHOD_NAME(query, main_search: MainappSearch, executed, results, request):
    assert executed.hits.total["relation"] in ["eq", "gte"]
    context = {
        "query": query,
        "results": results,
        "options": main_search.options,
        "document_types": DOCUMENT_TYPE_NAMES,
        "map": build_map_object(),
        "pagination_length": settings.SEARCH_PAGINATION_LENGTH,
        "total_hits": executed.hits.total,
        "subscribable": params_are_subscribable(main_search.params),
        "is_subscribed": is_subscribed_to_search(request.user, main_search.params),
    }
    return context