Can the fuzzy match in note search ignore spaces and prioritize note names, not directories?

I’m not sure if this behavior changed, but it appears fuzzy match is far more restrictive now. The ultimate solution might be to allow user-defined behavior for fuzzy match in general settings.

I’m using version v1.5.11.

Use case or problem

Here are two examples to illustrate two separate issues.

EXAMPLE 1: Lack of Spaces Breaks Fuzzy Match

  • I have a note called “Favorite Dog Breeds”
  • If I type CTRL + O to open search and then type “favd”, I don’t see the note.
  • I would prefer to be loose when I type and it finds the right note.

“fav” finds the note.
image

“favd” doesn’t find the note.
image

“fav d b” finds the note again.
image

PROPOSED SOLUTION: I’d like the option for fuzzy match to ignore spaces. Then, if I decide to type spaces into my search, it just makes the fuzzy match even more refined. So best of both worlds.

EXAMPLE 2: Search Prioritizes Directories Over Note Names

  • I have a note called “E, Vitamin E”
  • If I type CTRL + O to open search and then type “vitamin” I see a list of my notes, including “E, Vitamin E”
  • If I then type “vitamin e” (adding the space and “e”) the note called “E, Vitamin E” moves far down the list to #10. Above it are a bunch of notes also contained in a directory called “vitamins” but that have no letter “e” contained in the actual note name.

“vitamin” finds the notes
image

“vitamin e” prioritizes many notes before “E, Vitamin E” note is listed.

PROPOSED SOLUTION: Have fuzzy match give priority in this order. (Note, this assumes spaces are not needed.)

  1. Note name contains the match and also begins with the match. (Note name is “Vitamin E” - when search term is “vitame”)
  2. Note name contains the match but doesn’t begin with the match. (Note name is “E, Vitamin E” - when search term is “vitame”)
  3. Directory begins with the match (Directory name is “Vitamins” - when search term is “vitam”)
  4. Directory contains the match but doesn’t begin with the match. (Directory name is “Favorite Vitamins” - when search term is “vitam”)
2 Likes

I second this! I could’ve swore I was able to use fuzzy search without spaces, but I think I’m misremembering things, since there are another posts concerning this.

Hope this gets implemented!

1 Like

Bumping this, it’s a midway between a feature request and a bug.

In the Sandbox vault, I can link to a note called Note Number One by typing [[nonuon. In my main one, however, the same exact query results in No match found, unless I type each word separated with spaces – [[no nu on.

Disabling all plugins doesn’t help. I also compared the basic settings between the two vaults and can’t find anything that differs much.

The interesting thing is that if I copy the entire vault, fuzzy search in linking works as expected at first, but when the indexing is finished, it no longer works.

(Having over 10000 files is likely the problem. See this bug report)

That being said, I think the original post is still very valuable. The simplified quick switcher algorithm has some problems:

  1. Ignores search strings that appeared more than one time.

    • So “E cell”, “C cell” cannot be found because “E”、“C” already appeared in “cell” and are thus ignored. “pro project” will also be unretrievable among other "project"s.
  2. ignores their appearing order.

    • In this example, “flexor pollicis longus” ranked behind many files that don’t actually match “fl p lo” in the correct order. (It’s a muscle that moves your thumb, if you are wandering.)

My current vault is <4500 notes, so this is not the culprit I’m afraid :confused:

@GoldenSeal I can’t reproduce any of those behavior in the sandbox vault.
Perhaps you have more than 10K notes, so you should follow this FR instead.

@mythologies if you have less than 10K total files (not just notes). open a bug report and follow the BR template.

Thank you, I have around 15,000 notes/files so I’ll read that link.

The feature request may also be of interest: Quick Switcher: give priority to results that include space in search and/or are shorter

and this

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