From 1aa8556724597a5f041ce20882b06b85e6c8922e Mon Sep 17 00:00:00 2001 From: ru-danko Date: Mon, 23 Dec 2024 21:46:36 +0300 Subject: [PATCH] The sorting of words in the index has been removed, as it interferes with the current search algorithm. --- src/services/dictionary.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/services/dictionary.ts b/src/services/dictionary.ts index 62e139e3..25eabe33 100644 --- a/src/services/dictionary.ts +++ b/src/services/dictionary.ts @@ -245,7 +245,6 @@ class DictionaryClass { .get(id) .map((word) => this.searchPrepare(lang, word)) ) - break case ISV_SRC: splittedField = deduplicate( @@ -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 @@ -399,7 +398,6 @@ class DictionaryClass { const results = this.getWordList() .filter((item) => { const word = this.getField(item, lang) - if (!word || word === '!') { return false }