waterstrider123 · 2022-11-05 20:00
I am trying to setup a way to systematically search through all my org-roam notes and I came across the following code that uses consult-ripgrep:
(defun bms/org-roam-rg-search ()
"Search org-roam directory using consult-ripgrep. With live-preview."
(interactive)
(let ((consult-ripgrep-command "rg --multiline --null --ignore-case --type org --line-buffered --color=always --max-columns=500 --no-heading --line-number . -e ARG OPTS"))
(consult-ripgrep org-roam-directory)))
I am using doom emacs and I setup the above code in my `config.el` file. However, when I run `M-x bms/org-roam-rg-search` and type in anything, it asks me about 'matched required' as shown below:
https://preview.redd.it/bc0mqodfu6y91.png?width=1416&format=png&auto=webp&s=08f72ee119e7bec1076b1d243428fc38db60f9da
I am confused about what I am doing incorrect as it is searching the correct folder where my notes are stored and I am typing in keywords that exist in the directory but nothing shows up.
mclearc · 2022-11-05 22:44
You might try my [consult-notes package](https://github.com/mclear-tools/consult-notes), which enables searching across notes, including all nodes in your org-roam db. For the settings called by the function see [here](https://github.com/mclear-tools/consult-notes/blob/b2d6479715c89967d904d2577022ed6089aabd66/consult-notes.el#L76), and for the search function itself see [here](https://github.com/mclear-tools/consult-notes/blob/b2d6479715c89967d904d2577022ed6089aabd66/consult-notes.el#L256).
waterstrider123 · 2022-11-06 02:29
So I am trying to implement your package in doom emacs. I added the following in my `package.el` file: `(package! consult-notes :recipe (:host github :repo "mclear-tools/consult-notes")).`
I then added the following in my `config.el` file:
(use-package consult-notes
:commands (consult-notes consult-notes-search-in-all-notes
;; if using org-roam consult-notes-org-roam-find-node consult-notes-org-roam-find-node-relation)
:config (setq consult-notes-sources '(("Roam" ?o "~/org/references/notes/")))
;; Set notes dir(s), see below ;; Set org-roam integration OR denote integration
(consult-notes-org-roam-mode))
When I run `M-x consult-notes-search-in-all-notes`, I still get the same issue as above. It pops up the ripgrep buffer below and I simply type in a single character like 'a' which should show me some lists of matches, but there is nothing just like above.
mclearc · 2022-11-06 03:03
Have you checked just using (i) ripgrep from the commandline; (ii) consult-ripgrep in the dir? If neither of those work there is something else going wrong. If both of those work try slowly adding options to `consult-ripgrep-command` until you figure out where the error lies.
waterstrider123 · 2022-11-06 03:17
Ya, I opened eshell and navigated to `~/org/references/notes/` and then typed in `rg 'maps'` which prints out the matches below. For some reason, it doesn't show me any matches with `consult-ripgrep`
mclearc · 2022-11-06 03:59
good - so it is clearly a matter of the options being used by consult-ripgrep. So just go through those and see what is failing.
KleenexQ · 2022-11-06 08:48
I just rolled my own org-roam-search function
https://notabug.org/Category/org-roam-search