From b3dd2b0392e696f44279e5907d2f7aebb7fbcfdc Mon Sep 17 00:00:00 2001 From: aevum Date: Wed, 25 Nov 2026 02:41:40 +0530 Subject: [PATCH] docs(search): clarify Hamming distance without a vector index (#5198) ## Why The "Configure Distance Metric" section of `docs/web/search/vector-search.mdx` says `hamming` is supported for `IVF_FLAT` indexes only. That contradicts the runnable binary-vector example on the same page, which searches packed binary vectors with `distance_type("hamming")` and no index. A reader could think they must build an index before using Hamming distance. ## What changed - Say that `hamming` works for binary vectors without an index. - Keep the note that `IVF_FLAT` is the index type for indexed Hamming search. ## Scope Docs only: one sentence in the evergreen user guide. The same wording also appears in the saved Embedded v0.41.0 and Enterprise v1.12.0, v1.13.0 and v1.14.0 doc editions. I left those alone in case maintainers handle saved-edition corrections differently. ## Verification - Ran the website's binary-vector example test and both SDK binary-vector tests against the published `lancedb==0.41.0` wheel: `3 passed`. They confirm that unindexed Hamming search works. - `git diff --check` is clean. I did not render the page locally. This PR was prepared with AI assistance and reviewed before submission. --- docs/web/search/vector-search.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/web/search/vector-search.mdx b/docs/web/search/vector-search.mdx index 2c37fef43..bdad76889 100644 --- a/docs/web/search/vector-search.mdx +++ b/docs/web/search/vector-search.mdx @@ -126,7 +126,8 @@ For indexed search, supported distance metrics vary by index type: ### Configure Distance Metric Without a vector index, searches use `l2` by default. You can specify `cosine` or -`dot` instead (`hamming` is supported for `IVF_FLAT` indexes only). +`dot` instead. For binary vectors, specify `hamming` even without an index. If +you build an index for Hamming search, use `IVF_FLAT`. When a vector index exists, the search metric must match the metric used to build the index. If you explicitly request a different metric, LanceDB cannot use that