Skip to content

Commit

Permalink
fix(quote search): search service not building in code_javascript quo…
Browse files Browse the repository at this point in the history
…tes (@NadAlaba) (#5876)
  • Loading branch information
NadAlaba authored and Miodec committed Sep 12, 2024
1 parent d25b0d2 commit e27c4d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/ts/utils/search-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ export const buildSearchService = <T>(
rawTokens.forEach((token) => {
const stemmedToken = stemmer(token);

if (!(stemmedToken in normalizedTokenToOriginal)) {
if (!Object.hasOwn(normalizedTokenToOriginal, stemmedToken)) {
normalizedTokenToOriginal[stemmedToken] = new Set<string>();
}
normalizedTokenToOriginal[stemmedToken]?.add(token);

if (!(stemmedToken in reverseIndex)) {
if (!Object.hasOwn(reverseIndex, stemmedToken)) {
reverseIndex[stemmedToken] = new Set<InternalDocument>();
}
reverseIndex[stemmedToken]?.add(internalDocument);
Expand Down

0 comments on commit e27c4d6

Please sign in to comment.