diff --git a/docs/web/search/hybrid-search.mdx b/docs/web/search/hybrid-search.mdx index 6b769b6a8..86dc614a9 100644 --- a/docs/web/search/hybrid-search.mdx +++ b/docs/web/search/hybrid-search.mdx @@ -283,6 +283,12 @@ Set `limit()` to the number of results your application needs. The default is 10 A larger candidate set can help a reranker find relevant records, but adds work. +Each side of a hybrid query (vector and full-text) fetches at least 50 +candidates before rank fusion — `max(limit + offset, 50)` — so that asking for +fewer results returns a shorter list, not a different ranking. This candidate +floor is separate from `limit()`, which only controls how many fused results +are returned (default 10). + ### Returning row IDs {#returning-row-ids} Pass `with_row_id(True)` (Python) or `withRowId()` (TypeScript) to include the internal `_rowid` column in the results. This is useful for joining hybrid results back to a primary table, or for deduping across multiple queries: diff --git a/python/python/lancedb/query.py b/python/python/lancedb/query.py index 6d4ca9b13..c9fe2a22e 100644 --- a/python/python/lancedb/query.py +++ b/python/python/lancedb/query.py @@ -4723,14 +4723,14 @@ class AsyncHybridQuery(AsyncStandardQuery, AsyncVectorQueryBase): RRFReranker(K=60) ProjectionExec: expr=[vector@0 as vector, text@3 as text, _distance@2 as _distance, _rowid@1 as _rowid] LanceRead: uri=..., projection=[text], source=stream(_rowid) - GlobalLimitExec: skip=0, fetch=10 + GlobalLimitExec: skip=0, fetch=50 FilterExec: _distance@2 IS NOT NULL SortExec: TopK(fetch=1), expr=[_distance@2 ASC NULLS LAST, _rowid@1 ASC NULLS LAST], preserve_partitioning=[false] KNNVectorDistance: metric=l2 LanceRead: uri=..., projection=[vector], num_fragments=..., ... ProjectionExec: expr=[vector@2 as vector, text@3 as text, _score@1 as _score, _rowid@0 as _rowid] LanceRead: uri=..., projection=[vector, text], source=stream(_rowid) - GlobalLimitExec: skip=0, fetch=10 + GlobalLimitExec: skip=0, fetch=50 MatchQuery: column=text, query=[hello] Parameters