justintv / Twitch-API

A home for details about our API
www.twitch.tv
1.72k stars 380 forks source link

Search API #398

Open josephcricket opened 9 years ago

josephcricket commented 9 years ago

Looks like the search API has suffered some changes since yesterday morning. As of now, search queries are no longer considered as a logical AND, which makes it really difficult for users to refine the search.

So before yesterday, if you searched the query "my little pony" (without the quotes) the search API only returned results that had the words "my", "little" and "pony" among all the info (mainly status, username and game being played according to my observations).

Since yesterday, the search API will return all the entries that have either "my", "little" or "pony".

This behaviour was achieved on the previous search api version by using a logical OR (my OR little OR pony). The problem is that it seems to be now the default behaviour, and there doesn't seem to be possible to use a logical AND: "my AND little AND pony" seems to return the same results as "my OR little OR pony".

Do you plan to roll back the search API to the previous behaviour? Is there another way to use a logical AND in a single search query so we can match entries that have all the terms?

Thanks.

Pyyric commented 9 years ago

I've noticed this as well

Example of what happens: http://www.reddit.com/r/fighters

Most if not all of the streamers on the right side listed as "tekken tag tournament 2 (aka TTT2)" are streaming Dota 2.

Anyone streaming "Soul Calibur 5 (aka SC5)" is streaming Dark Souls, Diablo 3 reaper of souls, or Grand Theft Auto 5.

I'm going to have to remove or alter these games in our bot's database for now.

We haven't been able to change our bot to use the games?= api, it doesn't seem to work properly. It would be nice if the search feature had the ability for a logical AND like it did last week, or even searching a whole string.

DangerOnTheRanger commented 9 years ago

Chiming in to say this affects me as well.

Really hoping this gets resolved soon.

josephcricket commented 9 years ago

Looks like it's back to normal. I'll leave the issue open a couple days before closing it tho.

josephcricket commented 9 years ago

Ok, i've just noticed a slight difference between today's search behaviour and last week's:

Looks like we can search multiple terms again and the engine understands it as a logical AND, but it seems that it returns results only if all the terms are being found in one single property from the stream, not across all the properties. So it will only match if either the game property contains all the terms, or the status, or the game, but not if one term is found on the game property and another is found in the status.

So if we search for "starcraft espanol" aiming to retrieve all the streams that are currently streaming starcraft and have "espanol" in the status indicating it's a spanish language stream, with the previous API it would match "starcraft" on the game property and "espanol" on the status.

On the other hand, with the new API looks that we can only obtain results if the streamer has included both words in their status.

I think there should be a way to search on both game and status properties. Maybe a "game" parameter? it could work like this:

https://api.twitch.tv/kraken/search/channels?game=starcraft&query=espanol

Pyyric commented 9 years ago

Not returning random streams for whatever reason.

Currently streaming for the game Ultra Street Fighter IV: 2,117 viewers on FrameTrapTV 109 viewers on Rayoux 93 viewers on MDZ_jimmY 23 viewers on SinPhawks 17 viewers on classicfgctv 14 viewers on Xanoz_Ichimonji 8 viewers on AZAZEL_87 6 viewers on Xladyvalentinex 6 viewers on Akkirulez

But when you look for https://api.twitch.tv/kraken/search/streams?q=FrameTrapTV you get {"_total":0 ...

whereas https://api.twitch.tv/kraken/search/streams?q=MDZ_jimmY you get {"_total":1 ... and it shows the info.

So of the list of current top USF4 streams in the directory (I refreshed again to make sure they are still live and they are) There are only 4 showing. MDZ_jimmY, classicfgctv, xladyvalentine, akkirulez.

This happens for pretty much every game I'm searching for.

Using the api call https://api.twitch.tv/kraken/search/streams?limit=100&q=Ultra%20Street%20Fighter%20IV The streams that can't be searched by themselves also don't show up in the game name search.

Cronikeys commented 9 years ago

Boolean searches aren't working as far as I can tell. Broke a lot of stuff!

Example: https://api.twitch.tv/kraken/search/streams?limit=100&offset=0&query=%22sub%22%20AND%20%22attempts%22%20NOT%20%22subscribe%22%22

DeezjaVu commented 9 years ago

Using a limit other than 100 (the maximum) returns incorrect results as well. The top streams (viewer wise) are missing when searching for live streams and defining a limit other than 100.