diff options
| author | unwox <me@unwox.com> | 2024-10-17 16:40:38 +0600 |
|---|---|---|
| committer | unwox <me@unwox.com> | 2024-10-17 16:40:38 +0600 |
| commit | b9063b6e5ddf3f15ad75fad3b6a2fdb0e2bfe129 (patch) | |
| tree | 7b20073c02383b0317a61951a2016d6464cce0a6 /bin | |
| parent | b1acbab08ae8e33482e89b4674d1f41b0257f800 (diff) | |
new synonyms for queries
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/serve.fnl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bin/serve.fnl b/bin/serve.fnl index aeea929..988df00 100644 --- a/bin/serve.fnl +++ b/bin/serve.fnl @@ -26,6 +26,12 @@ (local query-synonyms { "шэн" "шен" "шен" "шэн" + "дянь" "дань" + "дань" "дянь" + "чжень" "чжэнь" + "чжэнь" "чжень" + "хун" "цун" + "цун" "хун" "доска" "чабань" "чабань" "доска" "термос" "бутылка" @@ -154,8 +160,9 @@ (table.insert where-vars (array.join (map (fn [_ q] - (if (. query-synonyms q) - (.. "(" q "* OR " (. query-synonyms q) "*)") + (local lower-q (must (luna.utf8.lower q))) + (if (. query-synonyms lower-q) + (.. "(" q "* OR " (. query-synonyms lower-q) "*)") (.. q "*"))) (str.split query " ")) " AND "))) |
