From c92d42f782e610dac4715663139166da6411bb0b Mon Sep 17 00:00:00 2001 From: Tito Bouzout Date: Mon, 27 Oct 2025 14:55:12 -0300 Subject: [PATCH 1/3] remove duplicate search results from index, fix incorrect urls --- src/ui/search.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ui/search.tsx b/src/ui/search.tsx index 1a2c3e0e8..2d6384ab5 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 = {} + 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( From 919267da4a124172c562a2fe820cdc73cb3bb85c Mon Sep 17 00:00:00 2001 From: Tito Bouzout Date: Mon, 27 Oct 2025 15:14:29 -0300 Subject: [PATCH 2/3] add missing type --- src/ui/search.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/search.tsx b/src/ui/search.tsx index 2d6384ab5..0674f9537 100644 --- a/src/ui/search.tsx +++ b/src/ui/search.tsx @@ -64,7 +64,7 @@ export function Search() { }); if (!result) return {}; - const seen = {} + const seen: Record = {} result.hits = result.hits.filter( hit => { hit.document.path = hit.document.path.replace("/index#", "#"); From bdf251c9cf8c2e41f8a3ab1c7afea4aa9868d252 Mon Sep 17 00:00:00 2001 From: Tito Bouzout Date: Mon, 27 Oct 2025 15:30:17 -0300 Subject: [PATCH 3/3] add semicolon --- src/ui/search.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/search.tsx b/src/ui/search.tsx index 0674f9537..33a3da7f2 100644 --- a/src/ui/search.tsx +++ b/src/ui/search.tsx @@ -64,7 +64,7 @@ export function Search() { }); if (!result) return {}; - const seen: Record = {} + const seen: Record = {}; result.hits = result.hits.filter( hit => { hit.document.path = hit.document.path.replace("/index#", "#");