Support Ticket

+status
answered
+tags
 
+issue

I'm trying to figure out how to make a search that will return a total count for multiple card types. I believe that's an OR not an AND, otherwise it would be looking for all the types in one? But an OR only returns 5 results, which isn't right either. The help page on searches has OR and AND as nested items, so that's what I did. I don't think it makes sense to have the "return": "Count" on each line, but if I don't it causes an error. 

 

What am I doing wrong?

{"type": "Episode", "return": "count",

 "or": {"type": "Major Character", "return": "count",

  "or": {"type": "Minor Character", "return": "count",

   "or": {"type": "Basic", "return": "count"}

   }

  }

}

 

Ah, that's not how "or" works. Normally WQL will return anything that matches *all* of the queries within it. "or" instead returns anything that matches even one of the queries within it. Unfortunately, since we're using JSON you can't have more than one "type" query in a set of {}s, which is why we created "in" - so that you can do this:

{"type": ["in", "Episode", "Major Character", "Minor Character", "Basic"],

"return": "count"

}

 

You will only ever need one "return"

--John Abbe.....2013-09-27 03:41:06 +0000