Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Note searching doesn't consider all tags #1728

Closed
ayrat555 opened this issue Aug 1, 2021 · 7 comments · Fixed by #1754
Closed

Note searching doesn't consider all tags #1728

ayrat555 opened this issue Aug 1, 2021 · 7 comments · Fixed by #1754
Assignees
Labels
1. bug Something isn't working 2. core Core functionality
Projects

Comments

@ayrat555
Copy link

ayrat555 commented Aug 1, 2021

Description

I just migrated to the org-roam v2. And I found that note searching can't find some notes by tags. For example:

Steps to Reproduce

Create two notes.

The first note

:PROPERTIES:
:ID:       E4F9AAA7-A49E-44DB-AD7D-0D08F4B28BF7
:END:
#+title: The Haunting of Bly Manor
#+filetags: :tv:tv_series:horror:drama:

The second note

:PROPERTIES:
:ID:       68E0EFA7-FB3A-420B-999F-DBB83E70E58B
:END:
#+title: Better call Soul
#+filetags: :tv:tv_series:dark_comedy:drama:
  1. Search drama
  2. Search horror

Expected Results

For drama search, both notes should be found.
For horror search, one note should be found

Actual Results

For drama search, only the second note is found
For horror search, nothing is found

Environment

Copy info below this line into issue:
- Emacs: GNU Emacs 26.3 (build 1, x86_64-apple-darwin18.2.0, NS appkit-1671.20 Version 10.14.3 (Build 18D109))
 of 2019-09-02
- Framework: N/A
- Org: Org mode version 9.4.6 (9.4.6-gab9f2a @ /Users/ayrat/.emacs.d/elpa/org-9.4.6/)
- Org-roam: 2.0.0

I'm using the latest version of org-roam from melpa - org-roam-20210801.626

I migrated to v2 today, before migration note searching considered all tags

@project-bot project-bot bot added this to Backlog in Org-roam Aug 1, 2021
@emacs18
Copy link
Contributor

emacs18 commented Aug 1, 2021

When you "search", which command do you have in mind?

@emacs18
Copy link
Contributor

emacs18 commented Aug 2, 2021

I tried org-agenda command then hit m to search for tags. That did not find the two simple files detailed above. However if I simply add a headline within either file, then the search was successful, i.e., the search was successful on following file simply by adding a headline.

:PROPERTIES:
:ID:       68E0EFA7-FB3A-420B-999F-DBB83E70E58B
:END:
#+title: Better call Soul
#+filetags: :tv:tv_series:dark_comedy:drama:

* One headline

I have not used #+filetags before, so I don't know whether files without any headlines are supposed to match tags searches.

@ayrat555
Copy link
Author

ayrat555 commented Aug 2, 2021

@emacs18 I'm using org-roam-node-find. In version 1 filetags were org_tags. It was possible to filter results by this field without using org/org-agenda functions

also, adding headings didn't solve the issue for org-roam-node-find

@ayrat555
Copy link
Author

ayrat555 commented Aug 2, 2021

It seems like it works if I leave a single filetag in these notes. Does it mean that org-roam doesn't support multiple tags for a single note?

@emacs18
Copy link
Contributor

emacs18 commented Aug 2, 2021

I am not familiar with org-roam version 1 behavior with regards to tags.
Also I have no idea whether org-roam-node-find should make use of tags.
I was assuming that the only names that org-roam-node-find used were the headlines or files with ID properties or aliases.

@ayrat555
Copy link
Author

ayrat555 commented Aug 2, 2021

Unfortunately, tags were one of the most useful features for me in the org-roam version 1. Maybe there's a bug in tags parsing.
I see one recent commit a84da59

@jethrokuan jethrokuan added 1. bug Something isn't working 2. core Core functionality labels Aug 2, 2021
@jethrokuan jethrokuan self-assigned this Aug 2, 2021
@jethrokuan
Copy link
Member

This is occurring because in the default org-roam-node-display-template, a very short string is allocated for tags, causing the rest of the tags to be truncated and therefore not available for search. This is definitely a bug that can be easily fixed, but I want to wait for #1724 so a less rebasing needs to be done.

For now, you can use this as a workaround:

(setq org-roam-node-display-template "${title} ${tags}")

ayrat555 added a commit to ayrat555/dot-emacs that referenced this issue Aug 2, 2021
jethrokuan added a commit that referenced this issue Aug 9, 2021
When strings in org-roam-node-display-template are truncated, they are
no longer searchable using completions, resulting in suprising
behaviour. This change allows truncated strings to still be searched
according to their original value. Closes #1728.
Org-roam automation moved this from Backlog to Done Aug 9, 2021
jethrokuan added a commit that referenced this issue Aug 9, 2021
When strings in org-roam-node-display-template are truncated, they are
no longer searchable using completions, resulting in suprising
behaviour. This change allows truncated strings to still be searched
according to their original value. Closes #1728.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. bug Something isn't working 2. core Core functionality
Projects
Development

Successfully merging a pull request may close this issue.

3 participants