Sort search results by relevance (and what relevance is)

I’ve seen requests for Smart sorting of search results. This is the simplest (and most common) example.

We need it for large vaults, as our work in Obsidian expands.

2 Likes

It would be helpful to be able to quickly see in which note a topic is discussed THE MOST. Similar to how Devonthink and Evernote can sort by ‘relevance’.

So a note that has the word ‘Agency’ in it 20 times would show above a note that just happens to have ‘Agency’ in it once.

It wouldn’t be the only way to sort results and links, the existing ones are excellent, but as a sort option.

13 Likes

Running into this same feature gap right now - what I’m searching for my #todo tag, I want to see the note with the most such tags in it at the top, rather than date or alphabetical sorting.

1 Like

+1

Also, I’d love if I could hit up,down (or cmd+j, cmd+k) to navigate the search results without having to click on the results with my mouse.

(Apologies if this should be a different request)

Using search you can change sort order. But there is no option to sort by frequency. what I mean is if a search keyword has many occurrences in a note. you can to be able to get that note first in sort order when searching.

2 Likes

Add your support to the feature request here:

1 Like

+1 for this. Giving results alphabetically is annoying

2 Likes

+1 for the feature to have the sort option by hits for each file. The file with the most hits for a search pattern should be the first. Would be absolutly great <3 :heart_eyes: and thank you for this great software! :slight_smile:

1 Like

Hey, just here to say this is a common frustration for me too. If I type exactly the name of a note in search, there is no sort order mode that shows said note at the top of the results – and search feels broken like this.

1 Like

Use case or problem

I have a note in a subfolder called “Timestamps/2021 Investing log.md”.
When I use the Open Quick switcher and I type “investing 2021” the note doesn’t appear in the results lists, it only appears if I type “2021 Investing”.

Proposed solution

Make Open Quick do basic tokenization or use fuzzy logic so that when I type “Investing 2021” it recommends notes called “2021 Investing.md”.

Current workaround (optional)

I have to manually type different note variations. I cannot realistically use the directory browser on the left side because I have too many notes and it would take me forever.

There’s a new plugin that may help:

Another vote for sensible search ranking. The current way Obsidian filters / sorts search results is quite frustrating!

I’m including my post to the Reddit forum here.

Hello,

I’m really enjoying Obsidian! I’ve spent the last two weeks consolidating 15 years and half a dozen applications worth of writing into one, sensible, well organised set of notes. Such a relief! :slight_smile:

The one thing that I’m quite frustrated by is Obsidian’s search. I’m baffled by the fact that it allows you to sort search results by everything except relevance. For example I have a page called “X3” in a folder called “Wiki” (my default home for new notes):

  • if I search for “x3” it shows up as the very last result (fair enough I had results organised alphabetically).
  • if I search for “title: x3” (or "title: X3) it doesn’t show up at all.
  • if I search for “path: x3” it’s the only result.

All the other note applications I’ve used over the years use relevance as the primary way to sort search results. I’d expect that if there’s a note called “X3” that it would be the top result of a search for “X3”.

I feel like I must be missing something? Am I doing something wrong? If this is just the way Obsidian works, is there a way to add relevance based search?

Many thanks for any pointers,
Adam.

Use case or problem

Search is one of the most important features for an app like Obsidian. Once I’ve made a lot of notes, I need to be able to search through them and efficiently find my old notes. The whole point of the knowledge storage system is to be able to retrieve information and ideas from the big archive I am creating.

Unfortunately, when I type anything I want to look for in the search panel, I’m getting extremely irrelevant results. They seem to match parts of the words (for example if I search for “make it work”, the top results are my notes on writing, because the word “write” has “it” in it), and they seem to be sorted by file name, not by relevance.

Putting my search query in quotes helps sometimes, but that doesn’t work very well if I only remember a part of the phrase I’m looking for, or several important keywords in the note, and not the exact perfect match for a phrase.

Proposed solution

I’m not sure what to recommend here. I can only say that quality search is a key feature for an app like Obsidian, it is extremely important to be able to retrieve the notes I have created quickly and conveniently, it is critical to have search that returns the most relevant results first. So this feature should just work better.

@lumenwrites : I do not have that experience. At my end Search works well, and words between quote marks represent a specific word combination that Obsidian searches for an finds. If, in your example, there is a note that has make it work but in a phrase like make it bloody work then Obs will not list it in your make it work query.

Furthermore, Obs Search also supports the very powerful regular expressions - Regex.

Use case or problem

When I search, generally I want the search to display items with the search in the title first and then other items below. The logic, often I’m using search to find a note that I know exists or I think should exist. Mentions of my search inside a note should be second because they’re less important.

Proposed solution

Either make this the default functionality or give us an option to affect the search.

Current workaround (optional)

None.

Version: 0.13.19
Installer: 0.12.15

4 Likes

+1 to this.

Even an opinionated way of doing relevance/best/score/whatever-you-want-to-call-it would be helpful for me. e.g. if I search for John Smith, then a note with “John H Smith” on one line should rank above a file with “John” on line 2 and “Smith” on line 180.

+1 for this. While relevance is indeed subjective to some extent, there are some clear rules which should work for everyone (else search engines like google would have no reason to be). A number of elements can be already considered in the note structure (such as title levels) and content (occurrence count, results position) to already provide an initial ranking likely to prove more effective than simple alphabetical ranking.

Furthermore adjusting the current odd default search settings seems necessary to me. Searching for “it” for example will bring up position as a result simply given position contains it. While there are some rare cases in which matching that way can be useful, it is usually not useful and simply clutter the search results (it could always be included, but then should be addressed as a less good match as if the exact term are found).

Searching through a vault is getting more critical as time goes and our vaults grow, and this is the last part of the software preventing this tool from going from excellent to exceptional!

(as a +1 including the ability to also include search query matches found in images in the search results similarly to Onenote would also further improve search)

1 Like

+1 from me. The OP’s simple logic seems to be a huge advance over the current functionality (which later can be improved with AI and more advanced search algorithms). As suggested by many, an idea could simply be to keep the current search algorithm, but let the user select among many. Like a drop-down list where I could choose which method of searching I would like to use.

For me this (improved/highly functional search capabilities) really is a key/core feature. The whole point of Zettelkasten is to not have to care about organizing your notes, but merely feed them to the system and design them in ways that they can be found in different contexts later when they have been forgotten. As Obsidian currently works, this is not the case. I often have to scroll down to the bottom of the search results to find a note that I REMEMBER exists (despite adding as many relevant tags AND filenames AND headlines as I can - with the purpose of making the note as “findable” as possible). This means that I am GUARANTEED to not be able to find notes that I no longer remember exists in contexts where I have tried to design them to be found - which is detrimental for the Zettelkasten method (which, as I understand it, is the main use case of Obsidian).

3 Likes

This.

Evernote is still king in this domain; search is everything.

2 Likes

I’d chip a+1 in for this one.

Coming from TiddlyWiki, the search there gives me what I need in the first few hits. In contrast I find the Obsidian search frustratingly bad. With several hundred files, results that should be clearly at the top are buried halfway down the list of irrelevant hits.

It doesn’t need to be the “perfect” way of sorting, just a better-than-alphabetically.