Skip to content

Add possibility to search a card with name in all languages at the same time#1181

Open
kvacquier wants to merge 1 commit intotcgdex:masterfrom
kvacquier:feat/search-any-language
Open

Add possibility to search a card with name in all languages at the same time#1181
kvacquier wants to merge 1 commit intotcgdex:masterfrom
kvacquier:feat/search-any-language

Conversation

@kvacquier
Copy link
Copy Markdown
Contributor

Changes

  • Added anyName query parameter to the GET /v2/{lang}/cards endpoint
  • Updated OpenAPI spec to document the new parameter

Details

The existing name filter only searches card names in the requested language. This makes it impossible to find a card if you only know its name in another language (e.g. searching name=Dracaufeu on /v2/en/cards returns nothing, even though Charizard exists).

The new anyName parameter searches across all 18 language card lists and returns the matching cards in the requested language:

GET /v2/en/cards?anyName=Dracaufeu     → returns Charizard
GET /v2/fr/cards?anyName=Glurak        → returns Dracaufeu
GET /v2/en/cards?anyName=eq:Pikachu    → exact match across all languages

It supports the same operator prefixes as other filters (like:, eq:, not:, neq:, etc.) and can be combined with any other query parameter (set, rarity, hp, etc.).


Note: since this repository is card data only, you may want to open the PR against the server repo instead if that's tracked separately. Let me know.

@thomas-bassett
Copy link
Copy Markdown
Contributor

Im not 100% sure this is an endpoint we would likly want, as it kind of breaks the search logic i.e Dracaufeu != Glurak while they match in name its not the sort of search behaviour I personally would expect.

the soultion i think is in another pr that i have open that links each card and returns all the endpoints for the differnt langagues of the same card.

this is possibly also a candiate for v3 of the graphql endpoint to allow you to filter by multiple langs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants