beets icon indicating copy to clipboard operation
beets copied to clipboard

Make fuzzy search ignore case by default

Open carreter opened this issue 4 months ago • 2 comments

Proposed solution

string_match method for FuzzyQuery should ignore case by making both pattern and value being matched against lowercase.

Objective

Goals

Make fuzzy searching... fuzzier. I don't see a scenario where one would want a fuzzy search but care about capitalization.

Alternative would be to make this behavior toggleable in the config or to have a different prefix for case sensitive vs case-insensitive fuzzy matching.

Non-goals

N/A

Anti-goals

This could result in unexpected behavior if a user depends on capitalization during fuzzy searching, but I don't see why one would.

carreter avatar Feb 23 '24 16:02 carreter

To be on the safe side, it might work similar to "smart case" in vim: it's ignoring case by default (assuming user's input is lowercased usually), but as soon as user put the uppercased char, case won't be ignored anymore.

mirkosoft avatar Mar 11 '24 12:03 mirkosoft

Smartcase is the current behavior, but I don't think I agree with it.

We are already fuzzy-searching, so the situations where the user would care about case seem quite rare. It's far more likely that they wouldn't care, and that smartcase would just make things more confusing.

carreter avatar Mar 11 '24 17:03 carreter