(fuzzy-match {:com.wsscode.fuzzy/keys [options search-input sort?]
:or {sort? true}
:as input})
Search for all matches of ::search-input in ::options. Options must be a collection of maps, the map key ::string will be used to make the lookup. By default the results will be sorted by score, use ::sort? false to keep original order.
Search for all matches of ::search-input in ::options. Options must be a collection of maps, the map key ::string will be used to make the lookup. By default the results will be sorted by score, use ::sort? false to keep original order.
(match-one {:com.wsscode.fuzzy/keys [search-input]}
{:com.wsscode.fuzzy/keys [string] :as opt})
Matches ::search-input with ::string from map. When match is valid the map is augmented with the keys ::match? ::match-score and ::match-hl.
(fuzzy/match-one {::fuzzy/search-input "a"} {::fuzzy/string "abc"})
; => {::fuzzy/string "abc"
; ::fuzzy/match? true
; ::fuzzy/match-score 8
; ::fuzzy/match-hl "<b>a</b>bc"}
Matches ::search-input with ::string from map. When match is valid the map is augmented with the keys ::match? ::match-score and ::match-hl. ```clojure (fuzzy/match-one {::fuzzy/search-input "a"} {::fuzzy/string "abc"}) ; => {::fuzzy/string "abc" ; ::fuzzy/match? true ; ::fuzzy/match-score 8 ; ::fuzzy/match-hl "<b>a</b>bc"} ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close