Find answers from the community

Updated last year

Filters

Are metadata filters supported for Postgres databases or am I missing something? I'm trying to use this code snippet, which is, admittedly, adapted from a Pinecone page not a Postgres page in the docs.

Plain Text
from llama_index.vector_stores.types import (
    MetadataFilter,
    MetadataFilters,
    FilterOperator,
)

filters = MetadataFilters(
    filters=[
        MetadataFilter(key="url", operator=FilterOperator.EQ, value="https://mysite.com/page"),
    ]
)
L
r
4 comments
Slowly rolling out new filters to vector dbs. Postgres only supports the old exact match filter
Only chroma and pinecone support the new filters so far.
Would love to see a PR if you are up for it ❤️
@Logan M If you could help me get started on a PR with some example code and general instructions, I might be able to take it to the finish line! Keep in mind that I'm primarily a tech writer, not a developer, but I'm willing to give it a try!
Add a reply
Sign up and join the conversation on Discord