diff --git a/src/ui/search.tsx b/src/ui/search.tsx index 1a2c3e0e8..33a3da7f2 100644 --- a/src/ui/search.tsx +++ b/src/ui/search.tsx @@ -63,6 +63,18 @@ export function Search() { mode: "fulltext", }); if (!result) return {}; + + const seen: Record = {}; + result.hits = result.hits.filter( + hit => { + hit.document.path = hit.document.path.replace("/index#", "#"); + if(!seen[hit.document.path]) { + seen[hit.document.path] = true; + return hit; + } + } + ); + const groupedHits = result.hits.reduce( (groupedHits, hit) => { const section = hit.document.section.replace(