From df9bdfecac46c88385e480b5f64a84326bb7b9e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Jos=C3=A9=20Borba=20Fernandes?= Date: Sun, 26 Jan 2025 23:25:49 -0300 Subject: [PATCH] Fix section resultMap callback --- packages/ui-stencil/src/services/SearchService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui-stencil/src/services/SearchService.ts b/packages/ui-stencil/src/services/SearchService.ts index 950b337..92e30d1 100644 --- a/packages/ui-stencil/src/services/SearchService.ts +++ b/packages/ui-stencil/src/services/SearchService.ts @@ -126,8 +126,8 @@ export class SearchService { for (const hit of hits) { const searchResultWithScore = this.hitToSearchResultParser(hit, resultMap) - const sectionKey = typeof resultMap.section === 'function' ? resultMap.section(hit.document) : resultMap.section - const documentSectionValue = hit.document[sectionKey] + const documentSectionValue = + typeof resultMap.section === 'function' ? resultMap.section(hit.document) : hit.document[resultMap.section] if (arraySectionMap[documentSectionValue] === undefined) { perSectionResults.push({