Find answers from the community

s
F
Y
a
P
Updated 4 months ago

how can you pass in metadata filters at

how can you pass in metadata filters at query time in llama index. is that supported?
for example something like this pseudo code..


Define the query with metadata filters

query = {
"query": "content",
"filters": {
"author": "Alice",
"date": "2023-01-03"
}
}

Execute the query

results = query_engine.search(query)
W
a
2 comments
I think you can take example from this https://docs.llamaindex.ai/en/stable/examples/vector_stores/Qdrant_metadata_filter/?h=metadata+fil

Also some third party vector store does not support metadata filtering.
@WhiteFang_Jr you have to specify this when creating the retriever though. i want to be able to make different queries with diff metadata filters without having to recreate the retriever or query engjne object. is that possibke
Add a reply
Sign up and join the conversation on Discord