summaryrefslogtreecommitdiff
path: root/bin/serve.fnl
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2024-10-10 15:13:16 +0600
committerunwox <me@unwox.com>2024-10-10 15:13:16 +0600
commit1520d83acccdcad2d7f87aec073b48d5f4995bf6 (patch)
tree6845c3016a4b37954aeb4d7ef0879d5fe76c57cb /bin/serve.fnl
parent240aeb84855a153764830186d5f4e7f22873561c (diff)
fix queries with synonyms and several words
Diffstat (limited to 'bin/serve.fnl')
-rw-r--r--bin/serve.fnl6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/serve.fnl b/bin/serve.fnl
index 63e4a3b..4d982c2 100644
--- a/bin/serve.fnl
+++ b/bin/serve.fnl
@@ -23,7 +23,9 @@
"шэн" "шен"
"шен" "шэн"
"доска" "чабань"
- "чабань" "доска"})
+ "чабань" "доска"
+ "термос" "бутылка"
+ "бутылка" "термос"})
(fn unescape [s]
(assert (= (type s) :string) "s must be string")
@@ -78,7 +80,7 @@
(.. "(" q "* OR " (. query-synonyms q) "*)")
(.. q "*")))
(str.split query))
- " ")))
+ " AND ")))
(local where-sql (array.join where-conds "\nAND "))
(local total