One of the inevitable truths of Living Card Games is that deck building becomes more difficult as the game grows. With an expanded card pool, there are so many cards to choose from, and unless you plan on building 70 card decks, there just is not enough room for every card that you want to play. For even the sharpest bear, we can find ourselves scratching our skulls, trying to remember that perfect card to round out our new shiny deck.
The need for an up to date and accurate search engine was the entire reason that I created The Hall of Beorn Card Search. But I am not a bear that it content to just sit still. One of the most requested features for the search engine has been for the ability to use multiple of the same filter. For example: what are all of the 2 cost allies from either the Spirit or Tactics sphere. Having made software for many years now, I have seen many dynamic query interfaces. There is one word that I would use to describe many of these interfaces: clunky.
At some point, I would love to create an elegant user interface to help users easily create searches with multiple filters and complex logic. With limited time to spend adding features to the card search, it does not make sense for me to spend hours and hours crafting the perfect advanced search interface – especially if not many users end up taking advantage of this feature. In the mean time, I have decided to provide the advanced search features that people have asked for, but leave the user interface alone.
The easiest way to do this was to define a special syntax for advanced searches, and update the search engine to check for searches that match this new syntax. Up until now, the search field has only been used to provide a string to match against the title and game text of each card. For example: searching for “Aragorn” will not only return the two hero cards with that title, but other cards that refer to him by name – his many attachments.
With the latest version, you can still use the search field for these types of basic search. In addition, you can use two special characters: “+” and “-“, to perform advanced searches. It is important to emphasize that advanced search in no way changes the preexisting functionality of card search. All of the filters that you select from drop down menus still work as expected. The best way to think of advanced search is another tool, that you can use in addition to the basic search features, to further refine your search.
The “+” is used to include a filter in your search, but it supports multiple values. So if you want to filter by Sphere, but you need to include more than one sphere in your search, you can include “+sphere:Leadership,Lore” in the search box. Logically any advanced search criteria is added (or ANDED, for those familiar with Boolean Algebra) to the existing basic search. This means anything you enter into basic search drop downs must be true, in addition to any advanced search filters.
So if you were to select Spirit from the sphere drop down menu, then enter an advanced search of “+sphere:Leadership,Lore”, you would get no results. This is because no card has both the Spirit printed sphere AND the Leadership or Lore printed sphere. In short, if you want to search for a given filter by multiple values, stick to advanced search and do not use the basic search filter of the same type. You can still mix and match basic and advanced filters of different types and it works as you would expect. For example selecting “Ally” from the card type drop down menu, then adding a search field of “rcost:2,3,5″ would return all allies with a resource cost of 2 or 3 or 5.
The “-” adds a filter, just the like “+” character, and also supports multiple values just like it’s less pessimistic brother. The difference is that the “-” character indicates a negated filter. For example, what if you want to search for all cards with the text “Aragorn”, except for those with the Spirit sphere. The advanced search “Aragorn -sphere:Spirit” will give you just that. So let’s combine a few of these examples together into a more complex query. Let’s say that we want all Spirit or Tactics allies or attachments that cost between 2 and 4 resources, but don’t have the “Dwarf”, “Weapon” or “Armor” traits. Here is that search: “+sphere:Spirit,Tactics +type:Ally,Attachment -trait:Dwarf,Weapon,Armor”.
It should also be pointed out that advanced search is case insensitive, so the following search is equivalent to the one above: “+sphere:spirit,tactics +type:ally,attachment -trait:dwarf,weapon,armor”. In the case of traits, keywords, and especially card sets, some of them can be rather long – which makes them cumbersome to type and far too easy to misspell. To aid with filtering these fields, advanced search supports the “*” character as a “wild card”. For example “cycle:*shadow*” would give you cards from both the Shadows of Mirkwood cycle and the Against the Shadow cycle. Likewise “+set:the_hills*” would match The Hills of Emyn Muil, so that you don’t have to type out such a long name.
This latest example also highlights a limitation of advanced search. If you want to search for something with a space (e.g. “The Hills of Emyn Muil”), you need to use a “_” character instead of any spaces. This is because the search sees any text that does not start with a “+” or a “-” as a normal search. So if you entered a search of “+set:The Hills*” the search engine would see this as two separate things. First it would add a filter for any set named “The”, then it would do a search for all cards for the text “Hills*”. Since there is neither a set named “The”, nor any cards which contain the actual text “Hills*”, this search would return no results. So just remember, if you need to do an advanced search with a value that contains strings, the “_” character is your friend.
Now this is a whole lot of complex gibberish, and it can make one’s head swim. As a bear, I prefer concrete examples to abstract theory. I can’t eat an abstraction. So here is one last example to tie everything together:
+trait:silvan,noldor +type:ally +cycle:shadow*,*dwar*,again* -rcost:5
This returns all Silvan or Noldor allies from the first three cycles of the game that do not cost 5 resources (sorry Gildor). You can test this fancy search out right here. Because all searches in Hall of Beorn card search are represented as URLs, it is easy to share your advanced searches with others, simply copy and paste the link. So head on over to the newly updated card search, and try out some advanced search goodness. This is a complex subject, and bears are not always the best creatures to explain such wonders (sadly, no wizards were available to write this post), so feel free to ask questions in the comments below.
Without further ado, here are the available filters supported by advanced search.
|cycle||Card Cycle||Shadows of Mirkwood, Dwarrowdelf, Against*, gencon|
|set||Card Set||The_Dead_Marshes, *dunland*,|
|sphere||Sphere of Influence||leadership,tactics,spirit,lore,baggins,fellowship|