From e27c4d63c8eadb79c8343e5c59efa4b4e8871478 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+NadAlaba@users.noreply.github.com> Date: Thu, 12 Sep 2024 21:38:52 +0300 Subject: [PATCH] fix(quote search): search service not building in code_javascript quotes (@NadAlaba) (#5876) --- frontend/src/ts/utils/search-service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/ts/utils/search-service.ts b/frontend/src/ts/utils/search-service.ts index ea0cfe064ee7..14644c21dbeb 100644 --- a/frontend/src/ts/utils/search-service.ts +++ b/frontend/src/ts/utils/search-service.ts @@ -84,12 +84,12 @@ export const buildSearchService = ( rawTokens.forEach((token) => { const stemmedToken = stemmer(token); - if (!(stemmedToken in normalizedTokenToOriginal)) { + if (!Object.hasOwn(normalizedTokenToOriginal, stemmedToken)) { normalizedTokenToOriginal[stemmedToken] = new Set(); } normalizedTokenToOriginal[stemmedToken]?.add(token); - if (!(stemmedToken in reverseIndex)) { + if (!Object.hasOwn(reverseIndex, stemmedToken)) { reverseIndex[stemmedToken] = new Set(); } reverseIndex[stemmedToken]?.add(internalDocument);