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.
This commit is contained in:
aevum
2026-11-25 05:11:40 +08:00
committed by GitHub
parent 02eee69130
commit b3dd2b0392
+2 -1
View File
@@ -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