diff --git a/v2/docusaurus.config.js b/v2/docusaurus.config.js index 7c4e7c857f4de..fcaf0edbaa5fb 100644 --- a/v2/docusaurus.config.js +++ b/v2/docusaurus.config.js @@ -141,7 +141,7 @@ module.exports = { { hashed: true, language: ["en"], - searchResultLimits: 8, + searchResultLimits: 10, highlightSearchTermsOnTargetPage: true, }, ], diff --git a/v2/third_party/docusaurus-search-local/src/client/utils/SearchSourceFactory.ts b/v2/third_party/docusaurus-search-local/src/client/utils/SearchSourceFactory.ts index e2dfa37bc1ee4..3eaf99cc0c918 100644 --- a/v2/third_party/docusaurus-search-local/src/client/utils/SearchSourceFactory.ts +++ b/v2/third_party/docusaurus-search-local/src/client/utils/SearchSourceFactory.ts @@ -74,10 +74,14 @@ export function SearchSourceFactory( } } - sortSearchResults(results); + // Filter out results from docs/api.md since that is covered via the + // docs/api/... pages (api.md exists for redirections from previous website) + const filteredResults = results.filter(r => r.document.u !== "/docs/api"); - processTreeStatusOfSearchResults(results); + sortSearchResults(filteredResults); - callback(results as SearchResult[]); + processTreeStatusOfSearchResults(filteredResults); + + callback(filteredResults as SearchResult[]); }; }