Try 30 days of free premium.

Why is the /search/shows?q=:query endpoint limited to 10 results?

Chopper wrote 2 years ago: 1

Hi,

Just wondering...

Thank you

Chopper wrote 2 years ago: 1

Hi, my number is around 50, based on the following discussion.  I don't know how search should work, but it does look like api results are just the first 10 website results so I kind of went down the rabbit hole of results generation trying to understand... All of the searches below are website searches that have results I would like to see returned in the api results.  I would love to hear your thoughts...

Using "Marvel" as search term, shows per results page I want in the api results

1: all 10
2: 6 out of 10
3: 6 out of 10
4: 8 out of 10 (which includes The Mighty Thor)
5: 5 out of 10 (which includes Prince Namor the Sub-Mariner)
6: 9 out of 10 (which includes The Incredible Hulk, The Invincible Iron Man, Captain America)
7: 2 out of 10
8: 1 out of 10
9: 2 out of 10
10: 1 out of 10
11-17: 0
------------------------
Total: 50 Shows

45 shows that have "Marvel" or "Marvel's" in the title
5 shows that do not have "Marvel" or "Marvel's" in the title

Using "Marvel's" as search term, shows per results page I want in the api results

1: 7 out of 10
2: all 10
3: 8 out of 10
4: 9 out of 10 (which includes Loki, Fury Files)
5: 7 out of 10 (which includes What If...?, Inhumans)
6: 5 out of 10 (which includes The Gifted, WandaVison)
7: 3 out of 10 (which includes The Falcon and The Winter Soldier)
8: 2 out of 10
9: 2 out of 10 
10-11: 0
-----------------
Total: 53 shows

46 shows that have "Marvel" or "Marvel's" in the title
7 shows that do not have "Marvel" or "Marvel's" in the title

45 vs 46 shows, I could have miscounted, did not verify which shows are common to both lists.

However, 5 & 7 that do not have "Marvel" or "Marvel's" in the title.  
Why are the two sets of titles completely different?

So, it seems that the results include Marvel IP that do not have the search term in the title. In that case the following Disney+ shows are missing (the second search returned 4 disney+ shows missing the search term in the title):

Hawkeye
Moon Knight
She-Hulk
Secret Invasion
Ironheart
Armor Wars
I Am Groot

Given that The Gifted was returned in the second search, I would have expected to see Helstrom & Legion

I can find other shows based on Marvel Characters that don't have the search term in the title for Iron Man, X-Men, Wolverine, Blade...  There are 5 shows titled "The Invincible Hulk", but only one was ever returned (in the first search)

https://en.wikipedia.org/wiki/List_of_television_series_based_on_Marvel_Comics_publications

I don't know if the above list is complete, did not check to see that each one is in the TVMaze db.

Also, several results unrelated to the search term make no sense at all, even for fuzzy search...
 

 

Chopper wrote 2 years ago: 2

Another question:

Using website search for "Law & Order" or "Law and Order", all the shows (9) in the Law & Order franchise appear in 1st page results

Using api search for "Law and Order", same result.

Using api search for "Law & Order", none of the franchise shows appear in the results.  Why is this?

 


david wrote 2 years ago: 1

@Chopper wrote:
Hi, my number is around 50, based on the following discussion.  I don't know how search should work, but it does look like api results are just the first 10 website results

Correct, the search algorithm on the API and the site are the same.

 so I kind of went down the rabbit hole of results generation trying to understand... All of the searches below are website searches that have results I would like to see returned in the api results.  I would love to hear your thoughts...

I'm just trying to understand: what exactly is your use case with a search term like this? You're obviously not looking for a specific show, which is what the search endpoint was meant for.

However, 5 & 7 that do not have "Marvel" or "Marvel's" in the title.  
Why are the two sets of titles completely different?

That's simply how the fuzzy matching (typo correction) works. F.e., "Mortel" differs by only 2 characters from "Marvel", so it's match. But "Mortel" differs by 3 characters from "Marvels" (the apostrophe is ignored), so it's not a match there.

So, it seems that the results include Marvel IP that do not have the search term in the title. In that case the following Disney+ shows are missing (the second search returned 4 disney+ shows missing the search term in the title):

The search only works on the show's name and AKA's.

Hawkeye
Moon Knight
She-Hulk
Secret Invasion
Ironheart
Armor Wars
I Am Groot

Given that The Gifted was returned in the second search, I would have expected to see Helstrom & Legion

The Gifted is returned because it has an AKA "Marvel's The Gifted".

I can find other shows based on Marvel Characters that don't have the search term in the title for Iron Man, X-Men, Wolverine, Blade...  There are 5 shows titled "The Invincible Hulk", but only one was ever returned (in the first search)

Also simply explained by the presence of an AKA on https://www.tvmaze.com/shows/47271/the-incredible-hulk (The Marvel Super Heroes).

Long story short, the search function is meant to find shows based on their name/AKA. Using it for something like getting all Marvel-related shows is not possible.

 


david wrote 2 years ago: 1

@Chopper wrote:
Another question:

Using website search for "Law & Order" or "Law and Order", all the shows (9) in the Law & Order franchise appear in 1st page results

Using api search for "Law and Order", same result.

Using api search for "Law & Order", none of the franchise shows appear in the results.  Why is this?

 

You are probably not properly URL encoding the URL parameter.

Note the difference between http://api.tvmaze.com/search/shows?q=law+%26+order and http://api.tvmaze.com/search/shows?q=law%20&%20order

Chopper wrote 2 years ago: 1

@david wrote:
Correct, the search algorithm on the API and the site are the same.

I'm just trying to understand: what exactly is your use case with a search term like this? You're obviously not looking for a specific show, which is what the search endpoint was meant for.

That's simply how the fuzzy matching (typo correction) works. F.e., "Mortel" differs by only 2 characters from "Marvel", so it's match. But "Mortel" differs by 3 characters from "Marvels" (the apostrophe is ignored), so it's not a match there.

The search only works on the show's name and AKA's.

The Gifted is returned because it has an AKA "Marvel's The Gifted".

Also simply explained by the presence of an AKA on https://www.tvmaze.com/shows/47271/the-incredible-hulk (The Marvel Super Heroes).

Long story short, the search function is meant to find shows based on their name/AKA. Using it for something like getting all Marvel-related shows is not possible.

 

So,  I use TVMaze API in my show tracker app.  My use case is - Say some Marvel nerd wants to add more than 10 Marvel shows to the app.  Using "Marvel's" as search term I was expecting to get 10 shows that all start with the search term (which, because of fuzzy search can't be guaranteed, is that correct?  I think I get 8 out of 10).  But if the user had another 10 shows in mind, now it seems he would have to do 10 more specific searches.  I was hoping there was a way to prevent all those extra searches by getting them all returned in the original search. I should have stated my use case to begin with, sorry about that.  I started looking at website search to see if that would help me answer my questions, which is why I went down that rabbit hole and confused the issue.

But your answers give me more questions:

- If I api search on "Marvel's", why can't I at least get 10 out of 10 titles that start with "Marvel's" instead of 8/10 ?

- So the terms "Marvel's" and "Marvel" only differ by one char -- how come website search results aren't more closely aligned?  In fact, shouldn't the results at least contain almost all the same shows?

Thanks for your answers, I appreciate it.

Chopper wrote 2 years ago: 1

@david wrote:
You are probably not properly URL encoding the URL parameter.

Note the difference between http://api.tvmaze.com/search/shows?q=law+%26+order and http://api.tvmaze.com/search/shows?q=law%20&%20order

Well, the short story is I assumed Apple API worked a certain way (percent-encoding the &) because there is no doc on the issue, but it doesn't.  After internet research, it seems a lot of people have gone thru the same thing, and I learned the workaround.  I should have done this first before bringing it up with you.  Apologies again...

Try 30 days of free premium.