Skip to content

Results sorted by relevance to search query

Robert Spiegel edited this page Aug 10, 2018 · 2 revisions

In the "note taking business" its not only important to capture the information, but I would say even more important is to be able to locate them quickly at the right time.

The problem is, as you start having a lot of notes, let say few thousand, for many searches you often get many results. Many of them are "false positives". Although all of them contain the search words you used, not all of them are equally relevant. Of course you can use "advanced search syntax" like "intitle:" prefix, or you can spend hours tagging your notes, but often I found this unnecessary hassle.

Here example with NixNote 2.0 - results sorted by last modification - basically unrelated to what I want to find. I need to skim through the whole list to check where it is what I'm looking for.

The idea is to do some kind of relevance evaluation and sort "likely more relevant" hits towards beginning. Evaluating relevance is "rocket science", but I found out that quite simple algorithm does big improvement in daily usage.

Example with NixNote 2.1 - really most promising hits are really at the top:

The actual algorithm still has a room for improvements, currently it works like this: if the word from search term, is found in title the result gets +1 point, if its found in tag, it gets +1 point, if the result hit note is marked with "important" tag, it gets +3 points (this is "manual override" - sometime works sometimes doesn't). So marking with "important" makes it some kind of "favorite" or "pinned note" - but it only shows, when its a search hit. So you can thus have many hidden "favorites", which show on first places whenever they are search hit.

Then notes are sorted by count of points in reverse and by second criteria (currently always "last updated"). The notes with "points" get visual hint (I just used bold font for first version).

For some of the searches it works better, for some its not much difference, but overall its quite improvement (and the algorithm can be made better later - this is just first try). For this to work reasonably good, you need to fill meaningful note titles.