You asked for 10 results. You got 4.
transcript
You ask your database for 10 results. It returns 4. No error. No warning. Just 4.
Tickets in Postgres, with an HNSW index. You want the 10 nearest Hindi ones. Only 10 percent of tickets are Hindi. And the index runs on defaults. ef search is 40.
Here's the catch. The index runs first. It returns its 40 nearest tickets. Then the filter runs. 36 aren't Hindi. Gone. 10 percent of 40 is 4. That's your answer.
The query succeeds. Hindi users just get fewer, worse results. Some queries got 3. Some got zero.
The fix? Turn on pgvector's iterative scans. Filtered results stop coming back short. Or raise ef search, so more candidates survive. Language has a few known values. So give each a partial index. One customer's few thousand tickets? Just scan them exactly.
Filters bolted onto an approximate index silently drop results. So ask any vector store one question. Can it return fewer than k? So filter inside the search. Not after it.
Full breakdown in the lecture.