taw / magic-search-engine

Search engine for Magic cards
MIT License
47 stars 19 forks source link

Searching by reminder text #140

Closed pyyhttu closed 2 years ago

pyyhttu commented 4 years ago

Is there a way/plans to search cards by including also their reminder texts?

Use case: I searched today cmc=1 t:creature o:"when ~ dies" o:"creature token" but missed Grim Initiate, and now I'm thinking what other 1 cmc creature token generators I may have missed.

I read through syntax page, found out that "Reminder text is not included in Oracle search", and searched issues prior posting this question.

taw commented 4 years ago

Yeah, the search engine is stripping reminder text (except on Uncards), as this improves search results most of the time. So this doesn't return a lot of creatures with reach etc.

Magic cards have weird relationship with reminder text. As far as rules are concerned, it doesn't exist.

Sometimes same card in same set did or did not have reminder text, like 10e (nonfoil with, foil without).

Very often cards in same set with same mechanic will or won't have reminder text based on their rarity, or how crowded card is. So it's not a very reliable thing to search for.

I guess I could add a separate operator for this.

pyyhttu commented 4 years ago

Yes, a separate operator would fix above use case with Amass.

It would also resolve searches around various +1/+1 counter mechanics that are now baked into Adapt, Amplify, Bolster, Bloodthirst, Devour, Evolve...

taw commented 4 years ago

Such operator wouldn't match rares / mythics with those mechanics, but yeah.

pyyhttu commented 4 years ago

Hmm... but why wouldn't it though?

Sincerely asking since I find now plenty both rares & mythics with such keywords, and each one of their card templating does have a reminder a text.

taw commented 4 years ago

Right, so it looks like for those mechanics they have explanations.

It's quite random (by random I mean correlated with rarity, set, and card text amount). Like in Theros 4/5 mythic Gods had devotion reminder text, but 1 didn't. After that none of the new ones did.

glaebhoerl commented 3 years ago

The version of this feature which seems most useful (for my purposes) would be one where it essentially "macro-expands" keywords and ability words into their full rules text (basically, how the card could've been near-equivalently templated if the keyword didn't exist), e.g. "reach" would be replaced by "~ can block creatures with flying". Which'd probably be an additional filter like expandedoracle:, or something.

But it seems pretty nontrivial to get all the edge cases right, e.g. you probably don't want to expand when it's only a "mention", such as inside the context "can only be blocked by creatures with flying or reach" (or when the name of a card contains the word). And all the expansions would probably have to be written and coded by hand. (And some of them might need a lot of text, like idk Morph?) And you get fun things like should "flying" be expanded into "~ can only be blocked by creatures with flying", which is kind of silly (but maybe not a problem for searching purposes), or what you even expand "first strike" to, or should it even be expanded at all.

taw commented 3 years ago

@glaebhoerl Yeah, it's one of the features that's just hard to do well when you consider all the edge cases.

Wirox commented 3 years ago

In my opinion even the simplest implementation, i.e. just looking at the card's text property from MTG JSON would still be very useful. I believe this is roughly what Scryfall's fulloracle: operator does and I still use it fairly often, even though there are some edge cases where it doesn't work perfectly.

taw commented 3 years ago

They don't have any fulloracle: on their syntax page.

By the way, if there's some syntax Scryfall supports that mtg.wtf doesn't, feel free to create an issue. I usually create aliases, as for most queries it's very easy.

Wirox commented 3 years ago

They use an alias in their syntax page, although both fo: and fulloracle: work when searching:

Use the fo: operator to search full Oracle text only, which includes reminder text.

For example: https://scryfall.com/search?q=fulloracle%3Atoward+r%3Am

pyyhttu commented 3 years ago

Use case: I searched today cmc=1 t:creature o:"when ~ dies" o:"creature token" but missed Grim Initiate

They (Scryfall) use an alias in their syntax page, although both fo: and fulloracle: work when searching

https://scryfall.com/search?q=cmc%3D1+t%3Acreature+o%3A%22when+%7E+dies%22+fo%3A%22creature+token%22&unique=cards&as=grid&order=name

Yes, fulloracle: would indeed fulfill use case here, with added bonus having scryfall and mtg.wtf queries being compatible.

Though it would most probably mean that I'd start hammer double queries, because of the nagging feeling: "Did my query now return everything? Better make it sure with fulloracle..."

taw commented 2 years ago

fo: / fulloracle: now works, with ~ and regexp versions as well.

Example.