Exclude properties drawer from Unlinked References rg

I am using org-noter to annotate PDFs, by calling org-noter-insert-precise-note, which generates an org-heading with a property drawer contraining :NOTER_PAGE: which includes the title of the document.

Currently Unlinked References in the org-roam-mode buffer is returning hits from from :NOTER_PAGE: and other portions of the property drawers on each of these notes, which is not particularly helpful and adds quite a bit of clutter (example below).

Is there a was to configure the rg-command defined in org-roam-mode.el to exclude the properties drawers from the returned hits in unlinked references?

It’s hard to see what you really want to remove from the result.
I’d remove the entire “unlinked reference” section (easiest). I’m on Windows so it cannot even be used – I feel nothing is missing this way. You will remove the entire “clutter”.

If you want to keep the section but remove some text from each line that ripgrep returns, I don’t see any customizing options.

Have a look at variable org-roam-unlinked-references-result-re and function org-roam-unlinked-references-section.

You would probably need to do two things:

  1. Define your own regexp that assign groups for the parts you want to remove from the result (e.g. the text string “#+NOTER_PAGE:”)
  2. Override the function and work out a new logic that do not add the groups you want to remove – see how it constructs the displayed line is constructed (I think it’s f, row and col with using match-string and the number that represents the group).

I can’t test my theory as I don’t have the unlinked ref section altogether. But something like this should work.

Thanks @nobiot I’ll look into the variables you suggested and possibly defining my own regexp and update if I find a workable solution.

What I want to do is override the rg-command defined in org-roam-mode.el to exclude all results that contain the string :NOTER_PAGE: or :id:

I am getting two types of hits from the unlinked references rg-command:

  1. Hits from the actual content of my notes in org headings, which is useful and what I want to see in the Unlinked References section. There is no unwanted information from the properties drawers displayed in these hits.

  2. Hits from :NOTER_PAGE: and :id: in the properties drawers themselves, for which the relevant org heading does not contain any germane reference. This is because the title of the pdf :NOTER_PAGE: it is pointing to contains the string of the new node I am creating. What I end up with is 10’s to 100’s of hits showing me the same directory path from :NOTER_PAGE:

I see…
It could be as easy as adding another condition in this part in org-roam-unlinked-references-section:

(when (and match
           (not (f-equal-p (org-roam-node-file node) f))
           (member (downcase match) (mapcar #'downcase titles)))


(when (and match
           (not (f-equal-p (org-roam-node-file node) f))
           (member (downcase match) (mapcar #'downcase titles))
           (not (s-contains? ":NOTER_PAGE:" line t))
           (not (s-contains? ":ID:" line t))

I am assuming line contains the entire line of string returned by ripgrep.

EDIT: Sorry, you may not have package called s for s-contanis? function. But I think you get the idea I’m trying to convey.