def escape_facet_value(value: str) -> str:
    """Escape and quote a facet value for an Algolia search."""
    value = value.replace('"', r"\"").replace("'", r"\'")
    value = f'"{value}"'
    return value