diff --git a/docs/assets/plugins/search/search.js b/docs/assets/plugins/search/search.js index 186cf555..220a1a4a 100644 --- a/docs/assets/plugins/search/search.js +++ b/docs/assets/plugins/search/search.js @@ -219,13 +219,7 @@ await searchIndex; const hasQuery = query.length > 0; - let matches = hasQuery ? searchIndex.search(`${query}`) : []; - - // Fall back to a fuzzy search if no matches are found - if (matches.length === 0 && hasQuery) { - matches = searchIndex.search(`${query}~2`); - } - + const matches = hasQuery ? searchIndex.search(`t:*${query}*^20 h:*${query}*^10 ${query}~1^5 *${query}*^0`) : []; const hasResults = hasQuery && matches.length > 0; siteSearch.classList.toggle('site-search--has-results', hasQuery && hasResults); siteSearch.classList.toggle('site-search--no-results', hasQuery && !hasResults); diff --git a/docs/resources/changelog.md b/docs/resources/changelog.md index 6e980e78..dd236146 100644 --- a/docs/resources/changelog.md +++ b/docs/resources/changelog.md @@ -14,6 +14,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis - Fixed a bug that allowed `` to open and close when disabled using a screen reader [#658](https://github.com/shoelace-style/shoelace/issues/658) - Implemented stricter linting to improve consistency and reduce errors, which resulted in many small refactors throughout the codebase [#647](https://github.com/shoelace-style/shoelace/pull/647) - Improved accessibility of `` and `` by making the title an `

` and adding a label to the close button +- Improved search results in the documentation - Refactored `` to use `Intl.NumberFormat` so it supports localization - Refactored themes so utility styles are no longer injected as `