def test_filter_array_of_strings(
    os_stores: List[OpensearchVectorStore], insert_document
):
    """
    Test that OpensearchVectorStore correctly applies Filter.Operator.IN filters
    when the filter value is an array of strings. Should only match all members
    of the input array exist in the field.
    """
    for os_store in os_stores:
        for metadata, id_ in [
            ({"location": ["Nevada", "California", "Illinois"]}, "match1"),
            (
                {"location": ["Florida", "Nevada", "California", "Kansas", "Illinois"]},
                "match2",
            ),
            ({"location": ["New York", "Nevada", "Oregon"]}, "nomatch"),
            ({"location": ["Alaska", "Hawaii"]}, "nomatch"),
        ]:
            insert_document(os_store, doc_id=id_, metadata=metadata)

        query = _get_sample_vector_store_query(
            filters=MetadataFilters(
                filters=[
                    MetadataFilter(
                        key="location",
                        value=["Nevada", "California", "Illinois"],
                        operator=FilterOperator.IN,
                    )
                ]
            )
        )
        query_result = os_store.query(query)

        doc_ids = {node.id_ for node in query_result.nodes}
        assert doc_ids == {"match1", "match2"}

    Test that OpensearchVectorStore correctly applies Filter.Operator.IN filters
    when the filter value is an array of strings. Should only match all members
    of the input array exist in the field.
    
llama-index-integrations/vector_stores/llama-index-vector-stores-opensearch/tests/test_opensearch_client.py