docs: def url_for_hit(hit, default="#"):
      """Helper for building URLs from results."""
      try:
          object_type = hit["object_type"]
          object_id = int(hit["id"])
          return current_app.default_view.url_for(hit, object_type, object_id)
      except KeyError:
          return default
      except Exception:
          logger.error("Error building URL for search result", exc_info=True)
          return default