trakt / api-help

Trakt API docs at https://trakt.docs.apiary.io
182 stars 7 forks source link

Should search results be sorted by score always? #479

Open michaldrabik opened 1 week ago

michaldrabik commented 1 week ago

Reporting a possible bug (?) As far as I understand search results should always return sorted by score which Is a value determining relevancy. Docs report that:

Search all text fields that a media object contains (i.e. title, overview, etc). Results are ordered by the most relevant score.

If you take this example it seems like it is not always the case:

https://api.trakt.tv/search/show,movie?extended=full&limit=20&query=from

Results are:

image

Is there a possible problem here or I misunderstand "score" in general? Thanks team!

rectifyer commented 5 days ago

It does an exact title match first, which I'm guessing are those first items.

michaldrabik commented 5 days ago

Understood.

Yeah in the example first show is "From". Next movie is Spiderman Far From Home.

So it's just a question if score should be updated to the highest before returning the list on the backend side. Or just mention it in docs. That's because if you sort by score on the frontend you will change intended results order.