emacsorphanage / helm-swoop

Efficiently hopping squeezed lines powered by Emacs helm interface
GNU General Public License v3.0
688 stars 55 forks source link

Avoid backlinks in the search results. #190

Open Ypot opened 3 years ago

Ypot commented 3 years ago

Hi

I use helm-swoop to search on my notes and interlink them. But after several interlinks (link + backlink) the search results are multiplied.

For example:

* TODO HEAD 1 with keyword1
  :PROPERTIES:
  :ID:       3835d3d0-931a-4a45-a015-a3d6a0baa99a
  :END:

This has a link pointing to below node, HEAD 2. And ccontains some keywords like keyword2

[[id:02a5da87-46e5-4ae0-85c1-ee63a570270a][HEAD 2 with keyword2]]

* TODO HEAD 2 with keyword2
  :PROPERTIES:
  :ID:       02a5da87-46e5-4ae0-85c1-ee63a570270a
  :END:
  :BACKLINKS:
[[id:3835d3d0-931a-4a45-a015-a3d6a0baa99a][HEAD 1 with keyword1]]
  :END:

This has a backlink as you can see from the BACKLINKS drawer above, to HEAD 1. And contain some keywords too.

There, if you search (helm-swoop) HEAD 1 or HEAD 2 you will get too the link and backlink which is generally useless and there could be a big number of them as the notes grow and get many interlinks.

Is it possible not to give results from links or to use some DRAWER like :BACKLINKS: from where helm swoop doesn't show the results?

conao3 commented 3 years ago

I think you can use :id: 3835d3d0-931a-4a45-a015-a3d6a0baa99a as query. How about it?

Ypot commented 3 years ago

I think you can use :id: 3835d3d0-931a-4a45-a015-a3d6a0baa99a as query. How about it?

Thanks, conao3. Not good, because the search is of concepts, key words in my notes. So I get a number of Heads which contain that key word and then I work with them.

conao3 commented 3 years ago

Sorry, I misunderstood your situation, you queried HEAD 1. I've tried like below.

head 1

Screenshot_2020-08-01_16-56-09

head\ 1

Screenshot_2020-08-01_16-56-23

\* head\ 1

Screenshot_2020-08-01_16-56-40

How about it?

Ypot commented 3 years ago

Thanks. I suppose that by using \* you are able to filter just the headings. But many times in the body there are keywords with "original information" that you don't get it in that way.

I have updated the example in the first post, so maybe I will get to show the search of keywords.

Ypot commented 3 years ago

Could it be possible to exclude some :DRAWER: (or all drawers) from the results?