Exclusive matches

19 views
Skip to first unread message

react...@gmail.com

unread,
Dec 14, 2012, 9:51:07 PM12/14/12
to picky...@googlegroups.com
I'm implementing a magic card search with picky, and I already implemented a category based on color which matches the five colors (white, blue, black, red, green). But if I search 'blue', it also finds cards that are blue and white. The new index should only match blue cards, not multicolor ones. Also, 'blue black' should only match blue/black multicolor cards. Note that there are cards which can be either paid with blue or black mana, so those should show up in 'blue', 'black', and 'blue black'.

Picky / Florian Hanke

unread,
Dec 17, 2012, 6:10:39 AM12/17/12
to picky...@googlegroups.com
Hi there,

Good question!

One idea is to implement your own syntax (easy to do).

Let's say "blue!" means exclusively blue. To do this, index exclusively blue cards using "blue!" (check for exclusivity when indexing and append a ! if yes). Multicolor cards use the same technique. A blue and black card would – for category color – index: "blue", "black" (both not exclusive, findable searching for "blue", or "black"), and "blueblack!" (exclusive).
Then, when searching exclusively, search for "blueblack!" when blue, black, and exclusive are selected.
I assume you have checkboxes or similar in the interface – you can use the Picky "before" callback to insert values from checkboxes to queries.

You are very flexible how to do this. Perhaps a "!" at the beginning of the query means: "search exclusively". You could detect this in the server, and only search the "exclusive" index. (You'd have a special exclusive index and a normal index)

Play with the flexibility! :)

If you have more questions, let me know,
   Florian

react...@gmail.com

unread,
Dec 20, 2012, 6:21:18 PM12/20/12
to picky...@googlegroups.com
Let's say I enter 'blue black'.

Then picky should display the following choices:

- only blue and black
- contains either blue or black

Note that only blue and contains black may match cards, but I don't think this is useful.

Is this possible without any additional syntax hacks?

Picky / Florian Hanke

unread,
Dec 20, 2012, 7:58:11 PM12/20/12
to picky...@googlegroups.com
Ok, I get it – what you'd like is an black OR blue query, with the additional restriction that it should _only_ contain those two colors.

How should the results be ordered? Still not sure what the point of this search is. Would the cards which contain both be displayed at the top? And the cards that contain either after that?
Would it make sense to issue three queries – and order:
1. both
2. blue
3. black

Not trying to be complicated – just trying to help you get a great search design. And that needs some thought :)

Cheers,
   Florian

react...@gmail.com

unread,
Dec 20, 2012, 11:09:29 PM12/20/12
to picky...@googlegroups.com
Am Donnerstag, 20. Dezember 2012 18:58:11 UTC-6 schrieb Picky / Florian Hanke:
Ok, I get it – what you'd like is an black OR blue query, with the additional restriction that it should _only_ contain those two colors.
Yes, but the first is an `AND` instead of an `OR`.
 
How should the results be ordered? Still not sure what the point of this search is. Would the cards which contain both be displayed at the top? And the cards that contain either after that?
Would it make sense to issue three queries – and order:
1. both
2. blue
3. black
The restricted should only display 1... ehm. Actually, this can be solved by better sorting instead of a new category. If I look for 'blue black', the results that contain both of those colors should come first. The others later. In case of a single-color search ('blue'), blue only should get a higher score as well.

But I'm not sure how to handle split-color cards - cards that are black and blue, but can be paid with either only blue or only black or a combination of the two. Those should appear in all three searches ('blue', 'black', 'blue black').
 
Not trying to be complicated – just trying to help you get a great search design. And that needs some thought :)
I know. Appreciated. :-) 
Reply all
Reply to author
Forward
0 new messages