From 1520d83acccdcad2d7f87aec073b48d5f4995bf6 Mon Sep 17 00:00:00 2001 From: unwox Date: Thu, 10 Oct 2024 15:13:16 +0600 Subject: fix queries with synonyms and several words --- bin/serve.fnl | 6 ++++-- 1 file 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 -- cgit v1.2.3