You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FAISS: filtered search misses matching documents outside the first top_k * 10 neighbours #4322
Describe the bug FAISSDocumentStore.search() with filters (and so FAISSEmbeddingRetriever) only looks at the first min(ntotal, top_k * 10) nearest neighbours and filters those. If the matching documents are further away than that, the search returns fewer than top_k results, or nothing at all, even though filter_documents() finds them.
Expected behavior ['de'] from both search() and the retriever. A filtered search should return up to top_k matching documents whenever the store has them, as the other document stores do.
Additional context
Seen on main (07a6e48), Python 3.13. A small fix is to search again with a larger k (doubling, up to ntotal) when the filters leave fewer than top_k results, so unfiltered searches and the common case don't change. I have a fix with a test ready and will open a PR.
Activity