# Quick Switcher - Link suggestion: give priority to results that include space in search and/or are shorter

**URL:** <https://forum.obsidian.md/t/quick-switcher-link-suggestion-give-priority-to-results-that-include-space-in-search-and-or-are-shorter/85858>\
**Category:** Feature requests\
**Tags:** quick-switcher, valuable, ui-ux\
**Created:** [July 24, 2024, 1:14pm UTC](https://forum.obsidian.md/t/quick-switcher-link-suggestion-give-priority-to-results-that-include-space-in-search-and-or-are-shorter/85858 "2024-07-24T13:14:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![huulong](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@huulong](https://forum.obsidian.md/u/huulong)\
**Post date:** [July 24, 2024, 1:14pm UTC](https://forum.obsidian.md/t/quick-switcher-link-suggestion-give-priority-to-results-that-include-space-in-search-and-or-are-shorter/85858/1 "2024-07-24T13:14:01Z")

</div>

### Use case or problem

I know the filename including its spaces and I want to open this file. However, there are other similar files which have no space and a much longer filename that are given higher priority, when I start writing more characters in the search, even when I add the unique space.

Setup:

1. Create files “chapter 0.md”, “chapter0\_audio.md”, “chapter0\_image.md”

Search issue:

1. Open Quick Switcher (Ctrl+O) and search “chapter”  
=\> So far, “chapter 0” is displayed at the top, followed by `_image` and `_audio`

 ![image](https://forum.obsidian.md/uploads/default/original/3X/e/b/eb2427fd172571f491d8e103b11da6417878823a.png)

1. Append “0” → search “chapter0”  
=\> now “chapter0\_” files are shown first, but it makes sense

 ![image](https://forum.obsidian.md/uploads/default/original/3X/f/4/f4d4c3364e79b53fa17fe54587ad5a0a68e0458b.png)

1. Add a space before 0 → search “chapter 0”  
=\> same result as without space!

 ![image](https://forum.obsidian.md/uploads/default/original/3X/d/c/dcf2190c90849e926644407f6af9f8cab044d6e2.png)

So there are two issues:

- space is ignored from search so you cannot distinguish filenames by adding a space
- longer filenames may be prioritized, but it’s impossible to add _more_ characters to the shorter filename: at some point you’ve written the whole filename. This means that even an _exact match_ will be appear at the top!

### Proposed solution

I’d do the opposite:

- take space into account in search to prioritize matching results that have the matching space. If there are no such results, it’s okay to ignore it (it just affects priority)
- give priority to shorter results (that still match search, and that have a decent fuzzy match score compared to other filenames\*), since it’s easier to _add_ characters to match longer filenames, than to add characters to match a filename that’s already short (the extreme case being when you write the full filename already and cannot add more).

\* For instance, if the fuzzy match percentage of total filename characters becomes greater than the shorter filename match percentage, then you can put the longer filename at the top.

### Current workaround (optional)

Oddly enough, typing only “chapter” will bring “chapter 0” to the top, but I have no idea why.

### Related feature requests (optional)

I’ve seen other topics requesting to ignore spaces in Quick Switcher: [Can the fuzzy match in note search ignore spaces and prioritize note names, not directories?](https://forum.obsidian.md/t/can-the-fuzzy-match-in-note-search-ignore-spaces-and-prioritize-note-names-not-directories/78945)  
However, this is about ignoring spaces in the _result_. My issue is that _when the user types a space_ and _there is an actual space match_, this increases the priority of results matching the space too.
