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
Async hybrid query with .offset() repeats and drops rows across pages #4027
main (0.38.0-beta.3), reproduced against the published 0.37.1 wheel as well
What happened?
Paginating an async hybrid query with .offset() returns rows that were already on the previous page, and silently drops rows that belong on the current one.
.offset() on a hybrid query pushes the offset down into both sub-queries (HybridQuery::offset → inner_vec + inner_fts), so each of the vector and FTS sides independently skips its own first N rows before the two are fused and reranked. AsyncHybridQuery.to_batches then calls _combine_hybrid_results(..., limit=self._inner.get_limit()) without passing offset=, so the combined table is sliced from position 0 and the sub-query limits are never raised to limit + offset. The window ends up taken from the wrong place on both sides.
The sync path had exactly this bug and it was fixed in #3769. The async twin was not updated — and this was known at the time: the author of #3765 explicitly scoped it out, noting "the async path ... applies offset independently to each sub-query before combining/reranking ... That's a separate, Rust-level concern and is out of scope for this issue". As far as I can tell no follow-up issue was ever filed, so I'm filing one.
Only the async hybrid path is affected. Sync hybrid is correct since #3769, and plain vector/FTS queries are unaffected.
Are there known steps to reproduce?
Yes — build any table with both a vector column and an FTS index, then compare limit(4) against limit(2) and offset(2).limit(2) as above. It reproduces deterministically; a regression test covering it is in the linked PR.
Activity
fix(python): apply offset when combining async hybrid results (lanced…