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:
2026-05-26 13:21:53 -07:00
parent 85652a7ce7
commit 712b2c0cb8

View File

@@ -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