From 7a8dba4e7d91a6fde0fc8996b41d01194fdd6b90 Mon Sep 17 00:00:00 2001 From: Pablo Pettinari Date: Wed, 7 Aug 2024 21:34:31 +0200 Subject: [PATCH] fix transformitems function that process docsearch hits --- src/components/Search/index.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index 047427bc6d9..ccd4ce7b0a6 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -117,10 +117,8 @@ const Search = forwardRef( items.map((item: DocSearchHit) => { const newItem: DocSearchHit = structuredClone(item) newItem.url = sanitizeHitUrl(item.url) - const newTitle = sanitizeHitTitle( - item._highlightResult.hierarchy.lvl0?.value || "" - ) - newItem._highlightResult.hierarchy.lvl0.value = newTitle + const newTitle = sanitizeHitTitle(item.hierarchy.lvl0 || "") + newItem.hierarchy.lvl0 = newTitle return newItem }) }