Open ehsankf opened 2 days ago
The issue you're encountering, where applying a MetadataFilter
results in an empty list, could be due to several reasons:
No Matching Records: Ensure that there are records in your vector store where the source
metadata is exactly "git". If no such records exist, the filter will naturally return an empty list.
Filter Configuration: Double-check that the MetadataFilter
is correctly configured. The key
should be "source", and the value
should be "git". Also, ensure that the operator is set to FilterOperator.EQ
(equality), which is the default operator.
Data Consistency: Verify that the metadata in your vector store is consistent with the filter criteria. For example, check for any leading or trailing spaces in the metadata values that might cause the filter to not match.
Logical Conditions: If you are using multiple filters, ensure that the logical condition (AND
or OR
) is set correctly. In your case, since you are using a single filter, this might not be applicable.
If all configurations are correct and the issue persists, it might be helpful to inspect the data in your vector store to ensure it aligns with the filter criteria.
To continue talking to Dosu, mention @dosu.
What vector store are you using? Default?
I am using OpensearchVectorStore(client) .
@logan-markewich I realized the metadata parser put the prefix "metadata." before key. How to avoid it?
key = f"metadata.{filter.key}"
op = filter.operator
Question Validation
Question
The metadata filter returns empty.