Azure / Azure/azure-search-vector-samples

KNN returning values that don't adhere to the filter

Open
#110 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
910
Forks
377
PR merge metrics
No merged PRs in 30d

Description

This may be 'by design', but I hadn't expected it.

I'm using a filter which only returns matching projectId/ownerId values, but I'm setting TopK to 100.

In the result set, I'm finding entries where the 'ownerId' isn't one of the filtered values.

Does the nearest neighbor calculation not adhere to the filter I'm assigning? i.e. can it return results which are neighbors, but may not match the filters I've assigned?

```
type eq 'Content' and projectId eq 'f9b101c3-c2e4-4239-bfb9-66de4ef37f7d' and (ownerId eq 'c1f8c39e-e3ac-5e18-a282-5cde33c9d92a' or ownerId eq 'f9b101c3-c2e4-4239-bfb9-66de4ef37f7d') and (content/vectorType eq 'Content' or content/vectorType eq 'Page' or content/vectorType eq 'Chunk' or content/vectorType eq 'Segment' or content/vectorType eq 'Phrase' or content/vectorType eq 'Image')
```

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no file, test, or entry point. Start by reproducing the shown KNN query with TopK 100 and the supplied filter, then check whether returned ownerId values match it; done means establishing the documented filter semantics or confirming a defect.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.