def METHOD_NAME(self, request):
    search_type = request.GET.get("type", "auto")
    if search_type == "auto":
        # Cache regex results for performance
        inferred_search_type = getattr(self, "inferred_search_type", None)
        search_type = inferred_search_type or self.infer_search_type(self.get_query(request))
        self.inferred_search_type = search_type
    return search_type