Skip to content

Commit

Permalink
fix: search logic with the optimized indices
Browse files Browse the repository at this point in the history
  • Loading branch information
ru-danko authored Dec 23, 2024
1 parent 4534c56 commit 6d9b981
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/services/dictionary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ class DictionaryClass {
.get(id)
.map((word) => this.searchPrepare(lang, word))
)

break
case ISV_SRC:
splittedField = deduplicate(
Expand Down Expand Up @@ -320,8 +319,8 @@ class DictionaryClass {
].forEach((lang) => {
searchIndex[lang] = Array.from(this.splittedMap[lang].keys()).map((key: string) => [
key,
this.splittedMap[lang].get(key).sort(),
]).sort((a, b) => a[1][0].localeCompare(b[1][0]))
this.splittedMap[lang].get(key)
])
})

return searchIndex
Expand Down Expand Up @@ -399,7 +398,6 @@ class DictionaryClass {
const results = this.getWordList()
.filter((item) => {
const word = this.getField(item, lang)

if (!word || word === '!') {
return false
}
Expand Down

0 comments on commit 6d9b981

Please sign in to comment.