# Using consult-ripgrep with org-roam for searching notes

**URL:** <https://org-roam.discourse.group/t/using-consult-ripgrep-with-org-roam-for-searching-notes/1226>\
**Category:** How To\
**Created:** [January 27, 2021, 9:20pm UTC](https://org-roam.discourse.group/t/using-consult-ripgrep-with-org-roam-for-searching-notes/1226 "2021-01-27T21:20:16Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![emacsomancer](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/emacsomancer/32/532_2.png) [@emacsomancer](https://org-roam.discourse.group/u/emacsomancer)\
**Post date:** [January 27, 2021, 9:20pm UTC](https://org-roam.discourse.group/t/using-consult-ripgrep-with-org-roam-for-searching-notes/1226/1 "2021-01-27T21:20:16Z")

</div>

I find deft pretty slow, and even [notdeft](https://github.com/hasu/notdeft) isn’t as fast as I would like (and is harder to set up). ripgrep is very fast though, and the [consult package](https://github.com/minad/consult) includes a very nice `consult-ripgrep` function.

Assuming you have `consult` installed, here’s a useful function:

```
(defun bms/org-roam-rg-search ()
  "Search org-roam directory using consult-ripgrep. With live-preview."
  (interactive)
  (let ((consult-ripgrep-command "rg --null --ignore-case --type org --line-buffered --color=always --max-columns=500 --no-heading --line-number . -e ARG OPTS"))
    (consult-ripgrep org-roam-directory)))
(global-set-key (kbd "C-c rr") 'bms/org-roam-rg-search)

```

brief demo:

[https://i.imgur.com/4A8yoTd.mp4](https://i.imgur.com/4A8yoTd.mp4)

(`ripgrep` does have a `--files-with-matches` option, which in theory would produce output more similar to what deft/notdeft returns, but I haven’t figured out how to use it via `consult-ripgrep` yet.)

---

_[View the full topic](https://org-roam.discourse.group/t/using-consult-ripgrep-with-org-roam-for-searching-notes/1226)._
