Make tag search matching fuzzy-er in the editor

Use case or problem

I noticed that in 0.9.21, fuzzy matching was implemented, but IMO it’s not fuzzy enough :slight_smile:. After bringing this up here, it was deemed better to open a new feature request for this so here I am!

To quote myself directly, this is an example that I gave:

For example, say I have a tag #some/tag/hierarchy, ideally I’d like to see results returned if all I typed were #tagarchy. This is how systems such as OmniFocus behave, if you’re familiar with that tool.

IMO, currently tag search isn’t the greatest. Let’s say you have a lot of nested tags under one parent; if you don’t remember the full path but you do remember one of the tag’s parents, finding it by typing just the parent and the sub-tag might not produce the right results, and worse, might not return results at all. Let me further explain.

Say we have a more exaggerated nesting structure for a tag, like #foo/bar/baz/biz, where the bar and baz parents have many descendants, and even let’s say that biz is in several of the parent tags (and there are many other parent tags that I’m not going to type out for this example). We run into issues trying to find that tags such as:

  • Typing just the tag that I want, biz, might return too many results
  • Typing one of the parent tags (say bar) and you don’t remember exactly which subdirectory biz is in, you’ll still need to go through all of the baz-level descendants to find the biz tag you want
  • As noted above, typing barbiz doesn’t return anything at all, since Obsidian is not supplying an implicit wildcard between them

Proposed solution

I think that Obsidian should attempt to match anything it can based on what is given by the user, with a “ranking” algorithm that matches the text supplied from the closest match it can find to the most lenient match it can find. Some example applications that do things like this are:

  • OmniFocus’ tag system
  • Basically any IDE or code editor that has an autocomplete functionality (I’m thinking of VSCode when I am typing this up)

Current workaround (optional)

Currently there isn’t a workaround that I know of - basically when you start typing, you need to know the rest of the tag from then on

Please let me know if you need any additional details about the above! I’d even be happy if this was just a setting to turn on.

12 Likes

Please Please Obsedian people implement this feature. My tags are deeply nested and it is starting to be a real nightmare…It might result in entering the subtag twice in two different places without noticing it.

The following might be a ‘partial’ workaround, just to get the path of the child tag
The Idea:
Tags are written as text in the note, but prefixed with hash.
The child tag is preceeded by slash.
So the idea is to use these two feautres as follows:

  • Search for text (not tag) using the following format:
    “/childtag”
  • The notes containing that child tag will appear in the list.
  • Hover over any note, you’ll see the full path of the tag… then you can use it in your new not.

It is not a perfect solution, but at least it shows the exacpt path of the subtag if it exists

Second this request.

Am I missing something? I am getting NO fuzziness. For example, plural tags don’t show when I search for the singular. (E.G tag:airline does not return results with the tag “Airlines”. What am I missing?

Hopefully we can get some traction on this and re-surface it. I am trying to use tags more in my notes instead of always creating [[links]] but the lack of fuzzy matching is frustrating. I actually don’t think tags currently are fuzzy at all… I would say they allow for “partial matches” but fuzzy to me is like what the OP describes. Here is my similar example below that I posted in Discord server:

Has there been any talk about making #tag suggester / autocomplete fuzzy? I am trying to leverage #tags more as opposed to [[links]] for certain types of things in my notes but find myself time and time again wishing the tag autocomplete was fuzzy. For example if I have a tag #dev/idea/frontend/search and then I type #devsearch it would be amazing if it showed as a match.

Also to avoid confusion, because some of the comments above seem to be talking about when “Searching” for tags in the search view… I am talking about when auto completing tags while typing in my notes.

For me the perfect solution is to just implement exactly how [[page linking]] works as it is the exact kind of fuzzy I would like and expect for tags.

1 Like

+1 for this FR
I do not use nested tags a lot because of this reasoning

Often I am entering notes from my Android phone & the lack to use a fuzzy search with auto populate makes it a pain when on the phone. Still a pain from the PC but when time is against me in the field (which is often) I find even a higher level of friction

As mentioned here

Make tag search matching fuzzy-er in the editor - #6 by smurfman111

I am upvoting the idea for populating the fuzzy search in regards to the nested tags

Please add this feature. Nested tags are a pain without a fuzzier search. At the very least add the ability to toggle this feature.