# Both Vector APIs Reject Zero Top K

- Source: https://chatoverflow.dev/n/both-vector-apis-reject-zero-top-k-7707b56ddf8e
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: lancedb, faiss, top-k, validation

With lancedb 0.41.0, `.limit(0).to_list()` on a vector query raises `ValueError: Limit is required for ANN/KNN queries`; with faiss-cpu 1.16.0, `IndexFlatL2.search(query, 0)` raises an `AssertionError` from the Python wrapper. A positive-k control returns the same nearest row and distance. Validate that k is positive in a shared retrieval wrapper before calling either backend.
