Closed adzay closed 2 years ago
Hi @adzay,
Your wish is my command. 😉
I've just released v3.1.0 with updated docs for whereLike
and a new fuzzySearch
method which (for now) does just the same as you doing right now and combines multiple "orWhereLike"s.
So this method is just here for making your life as a developer (and others) easier so you do not have to implement this "cumbersome" process yourself (over and over again). 🙂
A more efficient way of searching is by just using the search
method but keep in mind this method only works for Character
, Collection
, Game
, Platform
and Theme
.
Sadly a better and more efficient fuzzy search technically is not possible at the time of writing.
Hi @adzay,
Your wish is my command. 😉 I've just released v3.1.0 with updated docs for
whereLike
and a newfuzzySearch
method which (for now) does just the same as you doing right now and combines multiple "orWhereLike"s. So this method is just here for making your life as a developer (and others) easier so you do not have to implement this "cumbersome" process yourself (over and over again). 🙂 A more efficient way of searching is by just using thesearch
method but keep in mind this method only works forCharacter
,Collection
,Game
,Platform
andTheme
.
Thank you! The updated docs is exactly what is needed! Especially the fuzzy search you made!
Regarding the 'search' method. Initially I used Game::search('Call Of Duty'), but it was not clear how to disable sensitivity or do that fuzzy search method I mentioned above: Is something like the below possible?:
Game::search('Call Of Duty',false)->orSearch('Call*',false)->orSearch('*of*',false)->orSearch('*Duty*,false)
I'm glad the docs helped you out 🙂
For my understanding, the search of the IGDB API does exactly what you need. It is case insensitive by default and the search is "fuzzy" as well where the results are sorted by relevance. So at first come results matching all words of your search query and afterwards results matching less words of your search query and so on.
So the following should work just fine:
Game::search('Call of Duty')->get();
I'm not on the PC right now but I will check this behavior tomorrow and will get back to you 👍🏼
So, I back checked it now. First of: The search method is case insensitive (as you can see in the screenshot below).
But sadly the search can not be combined with other where clauses nor multiple searches. (Whereas this is not a problem with this package but a limitation of the IGDB API)
Thank you! i will close this.
Btw, the webhooks CLI (igdb:webhooks:create) doesn't create any webhooks despite saying so. After running igdb:webhooks it says none created.
@adzay
Are you sure? 🤔
For me it's working:
Feel free to open a new issue so we can discuss over there and close this issue right here 👍🏼
Hi,
Can you add more in your readme to help search names with igdb filters (lower case, '*' etc)? Like the "whereLike" solution you posted here:
33
I was struggling with finding names with capitals and special characters for a while before i found your answer in the above link. Putting in the readme can help others
Also, if not a lot of work, can you put an example on how to make it as "Fuzzy search" as possible? e.g. Right now i split my search term by space and put each entry into multiple "orWhereLike"s. Maybe you know a more efficient way?