Skip to content

Commit ac00232

Browse files
authored
docs: Make search more strict (#3766)
1 parent 677aaec commit ac00232

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • docs/src/app/(content)/api/search

docs/src/app/(content)/api/search/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ export const { GET } = createSearchAPI('advanced', {
2323
...docsSource.getPages().map(buildIndex),
2424
...apiSource.getPages().map(buildIndex),
2525
],
26+
// Require every query token to match, with Levenshtein-1 typo tolerance.
27+
// Without threshold: 0, "camera devices" ranks pages that only mention "camera".
28+
search: { threshold: 0, tolerance: 1 },
2629
})

0 commit comments

Comments
 (0)