Grouping ORs with ANDs in arrays

From semantic-mediawiki.org

Wow, been spending all day trying to get this working correctly. I have a SemanticForms RunQuery with a form entry that asks for a location. I'd like for the ability to put in "Texas" or "Austin" or "Austin, Texas". The first two are easy, but having the entry work with an array of "Austin, Texas" is proving a nightmare. If I manually type in

{{#ask:[[City::Austin||Texas]] [[State::Austin||Texas]]}}

I get what I'm looking for. Austin is matched with City, Texas is matched with State, and only Austin locations are shown. If I try to use an array or variable like

{{#ask: [[City::{{#arraymap:{{{Entry|}}}|,|x|x|<no*wiki>||</no*wiki>}}]][[State::{{#arraymap:{{{Entry|}}}|,|x|x|<no*wiki>||</no*wiki>}}]]}}

I get an Error: the value was not understood. I feel like I've tried everything. I've even tried to do a vardefine before the ask, and then ask on the var. Any ideas on how I can get this to work? Thanks

22:39, 16 November 2012

It's probably the double pipes that don't work, even when enclosed within nowiki tags (btw, why the asterisk?). I'm not sure if I understand you correctly, but is the intended query equal to the following one?

{{#ask: [[City::Austin]] OR [[City::Texas]] [[State::Austin]] OR [[State::Texas]]
}}

In that case, this should do the trick, right?

{{#ask: {{#arraymap:{{{Entry|}}}|,|x|[[City::x]]|OR}} {{#arraymap:{{{Entry|}}}|,|x|[[State::x]]|OR}} 
}}
18:28, 30 April 2013

Define a template {{!}} as | and try to use the template as the separator in {{#arraymap:}}: {{!}}{{!}}.

18:55, 30 April 2013

Indeed:

AND {{#arraymap:{{{Entry|}}}|,|@@@@|[[City::@@@@]]| }}

OR [[City::{{#arraymap:{{{Entry|}}}|,|@@@@|@@@@|{{!}}{{!}} }}]]

18:12, 3 December 2014