Way to foreground certain folders for search (I don't want to exclude others, just emphasize the first ones)

Hi all :slightly_smiling_face:

I make heavy use of the option to exclude certain folders from searching.

However, now I just came across a use-case where I’m using the search function to search for strings in files, and I’d like to foreground, i.e. emphasize, certain folders over others.

In my case, I want notes from a folder called Sources to be higher/more important than those from my Daily notes.

I don’t want to exclude the Daily folder, as I do often look up stuff from meeting notes or similar. But if the string is found in both, the Sources notes should be higher.

Is this possible? Plugins, CSS or whatever are welcome too.

Thanks :slightly_smiling_face:

I don’t think the core search has a weighting/ranking knob for folders; path: is basically include/exclude, not boost. The low-tech workaround I’d use is two saved/bookmarked searches: first path:Sources your terms, then the broader search without the path filter. If you want a single ranked result list, try Omnisearch or another search plugin and check whether its scoring is good enough for this, but I would not expect CSS to help because the ordering is already decided before the results are rendered.

I agree with quietbadger27’s suggestion to bookmark a search for path:Sources (you may need to be more specific if you have multiple folders with that name, or other folders that contain that word). Then if that doesn’t find what you want, add a dash to the start (-path:Sources) to search the rest of the vault.

Thank you both!

I’ll try out Omnisearch again. I think what turned me off that last time was that I really like the core search’s sidebar view, so I can see what results there are and click my way through.