Search for headings in quick open and link creation

I think it would be useful if our quick open panel and link creation would search for anything that you can link to (including headings). Currently, it only searches for pages. Adding this would be useful to be open or link to a particular heading.

What I’m envisioning: say I have page with a heading head. If I’m in a different page, and I start writing [[head, it would be great if Obsidian can display page#head as a possible linking option. Similarly, in quick open, we could also be shown headings (with some indication they are on a particular page).

The current system expects me to remember where I would have placed a heading - specifically, what page I would have put the heading on. This is quite the task to remember! It’s a bit incongruent that we can link to headings but not directly be shown them in searches.

Right now, I have to search in all files to see if the heading exists somewhere. It’s workable, but it would be nice if we can stay focused on writing when creating a link. I think my suggestion (or something similar) would help people stay focused on writing while also enjoying the benefits of linking to headings.

12 Likes

A few concerns with making this:

  1. Since each page could have a lot of headings, and we won’t have an idea whether the text you’re typing is for note name or heading, you’ll get a lot less relevant search results (i.e. a lot of your searches will try to match headings)
  2. This could also be terrible performance wise - depending on how many notes you have and what kind of habit you have with headings, searching through them all could make the search experience very laggy.

I still think you’re proposing a valid use case though, so we may need to figure something out. Perhaps a mode you can “turn on” while searching to match all headings. It would be lag and try to match a lot of things, but you turn it on deliberately while searching so it won’t affect anyone until they do.

1 Like

Perhaps [[# or [[## does a global search of specifically headers and when selected places [[thenote#theheading]]

That way it’s a conscious action to do the “search all headers” and not the default.

You could also do a search for all files & headers too, to see anything linkable, but maybe that’s a different command as well?

There’s been times I want to search a heading and if the titles were in there it’d just clutter, but I could see a use for searching anything I can link to.

Perhaps for both of these concerns, all searches list pages first and headings second. Both in the visual display of the search results (to reduce clutter from headings) and in the backend search through notes (to reduce performance issues).

But it would be greatly appreciated in some form.

I think Fovea has a good suggestion as well if the performance issue is significant.

I can find the same name of the note in different folder currently. Can’t header do this like this? or making header first citizen…

It’s strange that in Obsidian Publish you can actually search headings. This is from help.obsidian.md:

obsidian headings search

This was implemented a while back [[##