diff --git a/_includes/algolia.html b/_includes/algolia.html index a63c375eb3..acba5d13db 100644 --- a/_includes/algolia.html +++ b/_includes/algolia.html @@ -9,6 +9,10 @@ searchResults.hide(); return; } + // Raise typo thresholds so short words (<=4 chars) like "gsoc" require + // exact matches, preventing fuzzy hits against unrelated XML tokens. + helper.setQueryParameter('minWordSizefor1Typo', 5); + helper.setQueryParameter('minWordSizefor2Typos', 9); helper.search(); searchResults.show(); } @@ -167,4 +171,4 @@

${title}

} }); - \ No newline at end of file + diff --git a/js/algolia-search.js b/js/algolia-search.js index 3528c6730f..abbf2bd0e4 100644 --- a/js/algolia-search.js +++ b/js/algolia-search.js @@ -9,6 +9,10 @@ const algoliaSearch = instantsearch({ searchResults.hide(); return; } + // Raise typo thresholds so short words (<=4 chars) like "gsoc" require + // exact matches, preventing fuzzy hits against unrelated XML tokens. + helper.setQueryParameter('minWordSizefor1Typo', 5); + helper.setQueryParameter('minWordSizefor2Typos', 9); helper.search(); searchResults.show(); }