Find answers from the community

Updated 4 days ago

Using metadata filters to filter by dates

Is it possible to use Metadata filters to filter by dates? Looking at the schema there doesn't seem to be a way to easily match years in a timestamp
L
d
6 comments
Hmm, very few vector stores support date filters, so it never got implemented
Some vector stores allow you to pass in the filters using the actual vector db filter language (elastic search, qdrant, azure ai search)
ok thanks for the info. I guess I'll have to make sure to separate the year in the metadata if thats something I'd be interesting in filtering on
and yeah im using the postgres vector store so I guess im outta luck for a more expressive query language
Would probably be an easy PR to sneak in a pg_filters kwarg, similar to qdrant
https://docs.llamaindex.ai/en/stable/examples/vector_stores/Qdrant_using_qdrant_filters/
Not sure what the input would be actually... I guess a sqlalchemy where statement?
Add a reply
Sign up and join the conversation on Discord