Beginner
Search with a payload filter
points is a list of (id, vector, payload). Write search(points, query, k, where) that returns the ids of the best k points by dot product, **only among points whose payload matches every key and value of where**, best first.
where can be None or {} (no filter). Filter first, then rank. Equal scores keep the original order.
What Check tests
- The filter removes the best match
- No filter keeps everything, ties in original order
- An empty filter works like no filter
- A filter that matches nothing returns an empty list
- All keys must match
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
main.py
Sign in to run your code.
Output
Press Run to see what your program prints.