summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/gnosis.el b/gnosis.el
index 5235430..2908643 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -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