Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Applying metadata filters before similarity calculations to limit the dense vector space #6

Answered by pamelafox
dhnanjay asked this question in Q&A

You must be logged in to vote

Yes, you can apply metadata filters, you just have to determine what metadata is appropriate to filter by. For example, in the AI Search RAG solution, we apply filters for selected categories and filters for data access control: https://github.com/Azure-Samples/azure-search-openai-demo/blob/a8b1202045294052bf86bb7e523d25ef270c0d8c/app/backend/approaches/approach.py#L120
The category filter is determined by a UI field, and the data access control filter is based on the logged in user's user ID and Entra groups.

We then pass those filters along with our search query, and AI Search applies the filters before doing the hybrid search.

You could also determine filters by looking at the users qu…

Replies: 1 comment

You must be logged in to vote
0 replies
Answer selected by multispark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants