Default the search to line:

Hello there, I am new to Obsidian. Trying to figure out how to best search my notes and find stuff.

My ideal search is to be able to;

  • Default the search to line:
  • AND between search term. I.e. The line must contain every search term (not just some of them)(I think this is my blocker)

Is such a thing possible? I was using VScode for my notes until I found obsidian…I have a few years of notes that I have just been comma seperating search terms next to a header. For example.

HOWTO: Search objects in SQL Server [SSMS, SQLServer, OtherSearchTerms, etc]

So 99.9% of the time I only want to search that line… by searching, HOWTO: SQL Server…or some such thing…


Thank you heaps for any thoughts

What about using: line: /^HOWTO:.*SQLServer/

That would limit the regex search to a line starting with “howto”. You might not need the “line:”, so try with and without it. I’m a little unsure whether the .* will include line endings.

Thank you. It’s close!

I can confirm I don’t need the line: using this above.

I’ll play with it some more and report back, but I think the problem becomes out of order search terms. I must admit I have been resisting regex knowledge for many many years. One of those things that pushes other stuff out of ones brain :slight_smile:

The other approach is to just redo the way I’ve done my notes…because the above is a lot of typing when the whole point is to find things fast and easy…I’m kinda attached to the line thing…:)…

Thank you!

This is already the default, as the Help page about Search says (space counts as AND).

You can bookmark a search for line:( to save some time.

I read that, but it doesn’t seem to behave that way. Maybe I have a setting I have accidentally done.

For example the image below… it has a bunch of stuff that doesnt include the search terms?

Sorry for being unco if that is the case :expressionless:

If I’m not mistaken, search terms are separated by spaces — so your example just searches normally for those 3 words. I think you need to group them: line:(apple orange pear). That’s why I included the opening parenthesis in my bookmark example.


ahh ic, thanks CawlinTefffid…

Line:(apple orange pear) indeed does the trick…

Now…I’d kill not to have to type the line:() keys…but I know that’s too much to ask :slight_smile:

Thank you everyone for your kind and helpful answers.

That’s what bookmarking it is for. :slightly_smiling_face:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.