----------------------
MetadataFilters
is a class in LlamaIndex that is used for filtering metadata in vector stores. Currently, it only supports exact match filters. You can create a
MetadataFilters
object by providing a list of
ExactMatchFilter
objects.
Here's an example of how to create a
MetadataFilters
object:
from llama_index.vector_stores.types import ExactMatchFilter, MetadataFilters
filters = MetadataFilters(filters=[
ExactMatchFilter(key='name', value='paul graham'),
])
In this example, the filter is set to match nodes with the metadata key 'name' and the value 'paul graham'. You can add more filters to the list if needed.
Source:
Vector Store Retrievers - Part 5 (
https://gpt-index.readthedocs.io/en/latest/reference/query/retrievers/vector_store.html)
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------