For context, I'm using a MilvusVectorStore. Creating a MetadataFilter on a string-valued property works:
expr = {
"key": "id",
"operator": FilterOperator.IN,
"value": "xyz"
}
metadata_filter = MetadataFilter.from_dict(expr)
metadata_filters = MetadataFilters(filters=[metadata_filter])
vsq = VectorStoreQuery(
query_embedding=[0.0] * 3072,
similarity_top_k=top_k,
filters=metadata_filters
)
collection.query(query=query)
If I try the same thing with an array or a value contained in an array, I can't get the filter to work:
expr = {
"key": "codes",
"operator": FilterOperator.EQ,
"value": "code1"
}
expr = {
"key": "codes",
"operator": FilterOperator.EQ,
"value": ["code1","code2"]
}