too many results , any workaround?
Currently I am implementing a search function to my page. If user searches something, server will send API request to omdbapi and return the result. Problem is I cannot force user to write more than 3 letters because https://www.imdb.com/list/ls073947731/ there are plenty movies with only one letter and maybe user wants to search that, maybe user needs that. But omdapi search returns "too many results" if length of query 's' is just two~three letters.
I tried
http://www.omdbapi.com/?apikey=myApiKey&s=the&type=movie but it returns "too many results" adding page like this http://www.omdbapi.com/?apikey=myApiKey&s=the&type=movie&page=1 doesn't help at all. Any workarounds not to see that too many results? searching by title returns only one result
Search is overall flaky and doesn't work very well for autocompleters (maybe that's intentional, as it requires a lot of resources to search while typing).
But the problem is that it does exact word matching. So "Love Adv" returns not found, where "Love Advanced" returns "Love Advanced Customization". This is problematic if you intentionally search for partial word matches, because you don't remember the exact word. Case in point: searching for "Cast" with type "series" won't return "Castle".
@oehqoehfo Hi there! I'm encountering the exact same issue as you. I was also hoping that adding page=1 to the query would mitigate this issue. Alas... Did you ever find a solution/work around for this? Thanks!
@therealsylaucoin Sorry for late response. Unfortunately I could not find any workaround for this problem. Gave up that and accepted that API cannot handle search request which hass less than 3 letters
Someone's probably gonna run into this same issue just like I did the other day. Anyway, here's how I solved it. You'll have to check for the search input, see if its size is less than 3 letters, and if it is, switch the url from www.omdbapi.com/?apikey=[yourkey]&s={searchQuery} to www.omdbapi.com/?apikey=[yourkey]&t={searchQuery}. Basically, you're gonna switch from "search" (s) to "title" (t) which will return you one specific movie/tv show. You can specify the search more in depth by adding, for example, "&type=movie" and "&y={yearOfMovie}" (this one should be added by the user). There aren't many movies to cover with less than 3 letters so this works as expected. To anyone reading this, I hope I helped, keep on coding!