From 82620b1b8edef9ef5eddf268c7ef58af8f97bb8e Mon Sep 17 00:00:00 2001 From: Jacky Hsu Date: Tue, 1 Dec 2026 22:25:56 +0300 Subject: [PATCH] docs: fix the hybrid search walkthrough (#5334) ## Summary - Import `lancedb` before the Embedded Python connection example uses it. - Explain how to use the default RRF reranker when skipping the optional setup step in Python or TypeScript. ## Testing - Ran the original walkthrough in fresh Python 3.12 and Node.js 24 processes. The Python connection raised `NameError`, and skipping the optional reranker setup raised `NameError` in Python and `ReferenceError` in TypeScript. - Ran the updated steps with the published LanceDB 0.42.0 Python and Node SDKs, real Embedded tables and full-text indexes, and deterministic test embeddings. Both explicit and default RRF returned the same four rows in the same order and with the same relevance scores in each SDK. - Checked the edited page with Vale 3.24.0 and checked the staged diff. AI assistance disclosure. OpenAI Codex reproduced the errors, prepared the documentation change, and ran the checks. --- docs/web/search/hybrid-search.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/web/search/hybrid-search.mdx b/docs/web/search/hybrid-search.mdx index 1a0210b5b..b617346fe 100644 --- a/docs/web/search/hybrid-search.mdx +++ b/docs/web/search/hybrid-search.mdx @@ -67,6 +67,7 @@ Run the steps for your chosen language in order, choosing one connection option. ```python Python icon="python" +import lancedb from lancedb.index import FTS from lancedb.rerankers import RRFReranker from lancedb.embeddings import get_registry @@ -202,6 +203,7 @@ await table.waitForIndex(["text_idx"], 300); ### 7\. Set Reranker [Optional] {#7-set-reranker-optional} RRF is the default. The examples below configure it explicitly. Other rerankers and their language support are described in [Reranking](/reranking). +If you skip this step, omit the `.rerank(reranker)` call in the next step. ```python Python icon="python"