taw / magic-search-engine

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

Printing-level has:foil / has:nonfoil #101

Closed taw closed 4 years ago

taw commented 6 years ago

This is another thing that's better left for mtgjson v4, but it will probably be out of scope at first, so we'll need to do it in indexer-level enrichment.

Rules as I recall them (need to verify):

It shouldn't be too hard to get 99% correct, except the way current deck indexer works messes this up, as we'd need to get foiling information for precons from deck index into main index.

IIRC there are even formats which care about foiling. I don't particularly want to add every such format, but one could at least query that.

taw commented 6 years ago

So I tried to take a stab at it. Errors are possible, but:

What's missing:

To do it right deck indexer will need to be integrated with main indexer somehow.

taw commented 6 years ago

Current "not supported yet" list:

taw commented 6 years ago

It's now much closer to reality:

taw commented 6 years ago

6 promo sets to go (all mixing foils and nonfoils I think).

There's one more problem, what should even be the UI? Card has foiling status which is one of nonfoil, foilonly, or both (there are no cards with neither foils nor nonfoils).

That means 8 possible queries, but two of them are pointless (all, none), and one is really weird (everything except both). So what are good queries?

Like for example it could do this:

Any query like foil:no can be read either as "has nonfoil" or as "doesn't have foil".

It feels weird to not have positive queries for those last two.

Is there even a good name for a nonfoil card?

(there are some other parts of the query language which are unintuitive so I keep forgetting how they work)

taw commented 6 years ago

That's actually even worse as foil:no can also mean "card doesn't have any foil printing", but it operates on printing level.

So -alt:is:nonfoil, but that's like triple negation.

In other words, data is 99% there, but UI is basically awful. (and that's why I'm not even putting it on syntax help yet)

taw commented 5 years ago

So mtgjson (and scryfall) have this information.

Due to this previous work I did, I ended up submitting a lot of error reports to mtgjson, but it should all be fine now.

We still could use better syntax for it.

taw commented 4 years ago

This works now, using mtgjson data (with a lot of bug reports from me).

Syntax is not too bad thanks to in: queries.