audiobookshelf icon indicating copy to clipboard operation
audiobookshelf copied to clipboard

[Enhancement]: Fuzzy search library

Open hobesman opened this issue 2 years ago • 4 comments

Describe the feature/enhancement

When searching my library, I would like search results containing the same words to show as match results. In my library I have a book called "Fancy Nancy's Splendiferous Christmas" which shows up if I search Christmas, but does not appear if I search "Fancy Christmas" within my library.

Could search be made to look for matches containing "Fancy Christmas" OR ("fancy" AND "christmas") OR "Fancy" OR "Christmas" The results could contain all of those, but prioritized in that order based on which term they match. That way "Fancy Christmas Recipes" is listed first (exact string match), then Fancy Nancy's Splendiferous Christmas (multi-word match), then Fancy Styles and Trends, and finally A Christmas Carol (single word matches).

It would get more complicated with multi-word searches but I imagine some sort of logic already exists that could be applied?

hobesman avatar Jan 13 '23 03:01 hobesman

Just thinking this through, the searches could be conducted in reverse order, starting with all the results matching any of the terms, then search among those for results matching all of the terms and put those at the top, then search among those for results matching the entire string and put those at the top. That way you're not searching the entire library anymore after compiling matches for each term. Just an idea.

hobesman avatar Jan 13 '23 06:01 hobesman

I'd like to expand this request into full fuzzy search capabilities

FerriteGiant avatar Jan 19 '23 22:01 FerriteGiant

shameless plug: https://github.com/leeoniya/uFuzzy#a-biased-appraisal-of-similar-work

leeoniya avatar Jan 22 '23 16:01 leeoniya

This should also include chapter names. Would be a nice side effect for using abs for music. But Im not sure if single chapters can be displayed as a search result but a result for the album/audiobook would be good enough I guess.

DirkIngo avatar Aug 07 '24 01:08 DirkIngo