Hearthstone

GRATIS
Door omgvamp | Bijgewerkt vor 22 Tagen | Entertainment
Populariteit

9.7 / 10

Latency

2,275ms

Serviceniveau

100%

Health Check

N/A

Terug naar alle discussies

Support fuzzy search by name

Rapid account: Mr Mint
MrMint
vor 9 Jahren

Would it be possible to add support to the single card endpoint (or a new endpoint) that allows searching for cards by partial name match?

ie: query with name of “Yse” returning ysera and any other cards that contain the string “yse”.

Thanks!

Rapid account: Mr Mint
MrMint Commented vor 9 Jahren

Looks great! Appreciate the quick support!

Rapid account: Omgvamp
omgvamp Commented vor 9 Jahren

I’ve added a new endpoint to support this. The endpoint is called “Card Search”. Check the documentation for more info.

Rapid account: Mr Mint
MrMint Commented vor 9 Jahren

Sorry about the delayed response!

I can understand your concern, but auto-complete is not the use case I am looking to address. The use case here is for a hipchat bot, where users are able to type a command such as /hearth card ysera, which will result in the bot posting a message to the room with some details on the card. Due to not being able to implement an autocomplete within hipchat, this means they need to spell the card name 100% correctly to get a result from the api.

And while I could indeed just seed a database and implement an api for it myself, that defeats the time savings of using a great api like this!

The bot currently supports magic the gathering, using this api https://deckbrew.com/api/

The bot:
https://github.com/MrMint/NerdBot

Rapid account: Omgvamp
omgvamp Commented vor 9 Jahren

If your developing some sort of app where users can search for cards in a search box by typing the cards name and it auto completes their search, the best practice would be for you to request “All Cards” from the API and store that data in some kind of database. Then perform the search on the data in your own database.

From an API standpoint providing a partial name endpoint wouldn’t necessarily be an issue but you can imagine that if everyone using the API would request cards while users are typing into a search box the amount of requests would be exponential, and thus the quality of the API would degrade.

I suggest you store the cards data in some kind of database and perform a search on that instead of having to hit the API multiple times.

If you had a different use in mind don’t hesitate to reply!

Doe mee aan de discussie - voeg hieronder een opmerking toe

Log in / Schrij u in om nieuwe opmerkingen te plaatsen