MetadataFilters
MetadataFilters
were introduced in version 0.10.19llama_index.core.vector_stores.types.py::MetadataFilters
:class MetadataFilters(BaseModel): """Metadata filters for vector stores.""" # Exact match filters and Advanced filters with operators like >, <, >=, <=, !=, etc. filters: List[Union[MetadataFilter, ExactMatchFilter, "MetadataFilters"]]
r = engine.query("some question")
yieldsFile /path/to/lib/python3.10/site-packages/llama_index/core/vector_stores/types.py:170, in MetadataFilters.legacy_filters(self) 166 for filter in self.filters: --> 170 if filter.operator != FilterOperator.EQ: 171 raise ValueError( 172 "Vector Store only supports exact match filters. " 173 "Please use ExactMatchFilter or FilterOperator.EQ instead." 174 ) 175 filters.append(ExactMatchFilter(key=filter.key, value=filter.value)) AttributeError: 'MetadataFilters' object has no attribute 'operator'
VectorStoreIndex
's default storage_context
is SimpleDocumentStore
and the PR is just for PGVectorStore
MetadataFilters
class is now defined as:class MetadataFilters(BaseModel): filters: List[Union[MetadataFilter, MetadataFilters]]