def _to_ha3_engine_filter(
    standard_filters: Optional[MetadataFilters] = None,
) -> str:
    """Convert from standard filter to Alibaba Cloud OpenSearch filter spec."""
    if standard_filters is None:
        return ""

    filters = []
    for filter in standard_filters.filters:
        if isinstance(filter.value, str):
            value = f'"{filter.value}"'
        else:
            value = f"{filter.value}"
        filters.append(
            f"{filter.key} {_to_ha3_filter_operator(filter.operator)} {value}"
        )
    if standard_filters.condition == FilterCondition.AND:
        return " AND ".join(filters)
    elif standard_filters.condition == FilterCondition.OR:
        return " OR ".join(filters)
    else:
        raise ValueError(f"Unknown filter condition {standard_filters.condition}")
Convert from standard filter to Alibaba Cloud OpenSearch filter spec.
llama-index-integrations/vector_stores/llama-index-vector-stores-alibabacloud-opensearch/llama_index/vector_stores/alibabacloud_opensearch/base.py