advplyr / audiobookshelf

Self-hosted audiobook and podcast server
https://audiobookshelf.org
GNU General Public License v3.0
6.36k stars 448 forks source link

[Enhancement]: searches sort generic matches before specific ones #1717

Open wtanksleyjr opened 1 year ago

wtanksleyjr commented 1 year ago

Describe the issue

When searching for a word that matches a Title, but also matches a Tag or Series, you will find all of the matches for the topic or series sorted before any matches of the title. The result is that due to searches returning only limited numbers of titles, large result sets usually don't return any title matches, making it very hard to find specific books.

I most often run into this when doing Matches on the first book of a self-titled series (it's not a "sometimes" thing, but an "always" thing, the book with an exact Title match will always be sorted after everything else in the Series even if the Series isn't an exact match), but it also shows up when doing a search for a word in a title that's also used in a Tag.

The extreme nature of the results here suggests that there was an attempt to do this right by grouping more exact matches before less exact ones, but then the list got reversed by accident.

Steps to reproduce the issue

  1. For example, the 4th book in the Vlad Taltos series is named "Taltos", but I cannot Match it using Audible, because there are too many books in the series, and the Matcher cuts off the list after a while (and the book whose title exactly matches is always at the end of the resulting list, so will be first to be cut off unless the series is short enough).
  2. Likewise, I have a Tag named "Science" and a Great Courses book named "The Joy of Science", the Search bar cannot be used to find that book unless I remember the whole title; the results will always attempt to display all of the Tag matches before the Title match, and cut off before displaying the book itself.

Audiobookshelf version

2.2.19

How are you running audiobookshelf?

Docker

advplyr commented 1 year ago

The match search is different from the global search bar inside the web app. The match search for Audible is not doing any sorting after Audible returns results. This is because Audibles sorting on queries will be better then what we build. I searched "Taltos" like you said using Audible.com provider and it was the second result.

wtanksleyjr commented 1 year ago

That you got a useful result is absolutely shocking to me. I'm not exaggerating when I say that EVERY search works as I've described -- I've never been able to do a match on the first book of a self-titled series on Audible results. I ran those two searches just before I filed that report, but I typed both up from scratch just knowing what would happen, and I didn't have to change them because when I ran them, they reproduced the problem exactly as I expected.

Of course, I sat down and tried this with "Hell Divers", and sure enough the self-titled first book was the 5th match (i.e. not utterly USELESS).

Ah well, Audible, where even the bugs are inconsistently buggy :) .

Maybe I should split this into two bug reports anyhow? I can see they're different, like you said.

-Wm

On Mon, Apr 24, 2023 at 3:28 PM advplyr @.***> wrote:

The match search is different from the global search bar inside the web app. The match search for Audible is not doing any sorting after Audible returns results. This is because Audibles sorting on queries will be better then what we build. I searched "Taltos" like you said using Audible.com provider and it was the second result.

— Reply to this email directly, view it on GitHub https://github.com/advplyr/audiobookshelf/issues/1717#issuecomment-1520907398, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ7H6MI32PESBU7IY3CNADXC347DANCNFSM6AAAAAAXJ5JSFQ . You are receiving this because you authored the thread.Message ID: @.***>

advplyr commented 1 year ago

We should be getting the same results from Audible. Here is what mine looks like

image

advplyr commented 1 year ago

I just realized looking at that again the second item is a different book.

That is strange actually that even including the author in the search it isn't showing that book in the series. Do you have another example I can try?

wtanksleyjr commented 1 year ago

I'm working late today, and suddenly can't remember any self-named series of sufficient length ... I sorted my series by length and got Redwall, but it's not the best example (it actually puts the titular book way toward the end of the list, but not ALL the way off the end). Vlad Taltos is still the only one I know of that does that.

On Tue, Apr 25, 2023 at 4:38 PM advplyr @.***> wrote:

I just realized looking at that again the second item is a different book.

That is strange actually that even including the author in the search it isn't showing that book in the series. Do you have another example I can try?

— Reply to this email directly, view it on GitHub https://github.com/advplyr/audiobookshelf/issues/1717#issuecomment-1522547211, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ7H6OO2VSGRZLFC6RY4CDXDBOAPANCNFSM6AAAAAAXJ5JSFQ . You are receiving this because you authored the thread.Message ID: @.***>

wtanksleyjr commented 1 year ago

I found another example -- "The Book of Deacon" by "Joseph R. Lallo" doesn't appear within the range of the search (it's the first book in a series). Very odd, actually, there are only 4 books so you'd think it would show.

advplyr commented 8 months ago

The match feature has been revised the last few versions. It is now sorting by duration so that the Audible result with the closest duration to your media will be at the top. This was added with #2400 Let me know if this solves your issue. We are also discussing matching in #2517

wtanksleyjr commented 8 months ago

That's an excellent idea! I agree that should solve the Match functionality, and I tried all the ones I could remember.

Would you like me to make a new issue for the Search functionality so you can close this one (in this case, searching for "Science" won't return a book named "The Joy of Science" because of all the books that match "Science" not in the title, and also searching for "Taltos" won't return the book titled "Taltos" because of all the books in the same series named "Vlad Taltos")?