- Newest
- Most votes
- Most comments
For the NOT EQUALS operator: If you use the notEquals filter for a field that doesn't exist in the metadata, it will return all documents where that field is not present. This is because the condition "not equal to" is satisfied when the field doesn't exist at all.
For the EQUALS operator: If you use the equals filter for a field that doesn't exist in the metadata, it will not return any documents. This is because no documents can satisfy the condition of being equal to a value for a non-existent field.
It's important to note that the API doesn't throw an error when filtering on non-existent fields. Instead, it processes the query based on the logic of the operators used.
To ensure more predictable results, it's generally a good practice to have consistent metadata across your documents and to be aware of which fields are actually present in your metadata before applying filters.
Sources
RetrievalFilter - Amazon Bedrock
FilterAttribute - Amazon Bedrock
Relevant content
asked a year ago
- AWS OFFICIALUpdated 15 days ago
