mcfly icon indicating copy to clipboard operation
mcfly copied to clipboard

Implement fuzzy search

Open meridius opened this issue 5 years ago • 5 comments

It would be great if results contained not only commands exactly matching the input, but allow for imperfections.

For starters ignoring special characters ([^a-zA-Z0-9]). Another round could implement real fuzziness (chars in incorrect order, typos made by pressing neighboring keys, ...).

meridius avatar Dec 11 '19 13:12 meridius

I think that's a great idea. Search is in sqlite, so whatever we do needs to be implemented there. Are you interested in working on it?

cantino avatar Dec 11 '19 17:12 cantino

Sure, I could give it a try. From a quick scan of a code it seems I should just compute the fuzzy strings and add them as OR LIKE to https://github.com/cantino/mcfly/blob/master/src/history/history.rs#L230 Could you confirm that please?

meridius avatar Dec 11 '19 22:12 meridius

Yes, that's correct.

cantino avatar Dec 13 '19 17:12 cantino

I suggest looking at skim

infokiller avatar May 11 '20 13:05 infokiller

Right now you can put a % in your search to do semi-fuzzy searching, but skim looks very nice. I'd be open to contributions that use it.

cantino avatar May 11 '20 21:05 cantino