fix: use cleansed-query for Solr client name search
Fixes substring search in company dropdown. The search query was using raw user input instead of the cleansed version that adds a wildcard suffix (e.g. 'dough' -> 'dough*'). Without the wildcard, Solr performs exact token matching, so searching 'dough' would not match 'Doughballs'.
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
(defn get-clients [identity query]
|
||||
(let [raw-query (not-empty (strip-special query))
|
||||
cleansed-query (not-empty (cleanse-query query))
|
||||
cleansed-search-query (str "name:(" query ")")
|
||||
cleansed-search-query (str "name:(" cleansed-query ")")
|
||||
exec-search (fn []
|
||||
(for [n (pull-many (dc/db conn) [:client/name :db/id]
|
||||
(for [{:keys [id name]} (solr/query solr/impl "clients" {"query" cleansed-search-query
|
||||
|
||||
Reference in New Issue
Block a user