diff options
author | Thanos Apollo <[email protected]> | 2024-04-16 14:51:16 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-04-16 14:51:16 +0300 |
commit | fa51be84b76ebf8616aa10097030abf32264885e (patch) | |
tree | caf2d8b688afe2b0074d51bdeafb58d5e08bf55e /gnosis.el | |
parent | dc38976f987cc640e4afc609370f38d950c48881 (diff) |
gnosis-search-note: Adjust for queries with multiple words
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1600,8 +1600,12 @@ to improve readability." Return note ids for notes that match QUERY." (cl-assert (or (stringp query) (eq query nil))) - (let ((query (or query (read-string "Search for note: ")))) - (gnosis-select 'id 'notes `(like main ,(format "%%%s%%" query)) t))) + (let* ((query (or query (read-string "Search for note: "))) + (words (split-string query)) + (clause `(and ,@(mapcar (lambda (word) + `(like main ,(format "%%%s%%" word))) + words)))) + (gnosis-select 'id 'notes clause t))) ;; Dashboard |