[ic] search-region.coretag

Peter peter at pajamian.dhs.org
Thu Dec 10 00:59:22 UTC 2020


On 9/12/20 11:11 am, mihai at airdelights.com wrote:
> Hello,
> 
> I am trying to understand some code which displays our orders in Interchange. This code uses the search-region tag to filter out orders.
> 
> 
> [search-region more=1 arg="
> ...
> 		sf=deleted
> 		se=1
> 		op=ne
> 		sf=status
> 		se=pending_approval
> 		op=eq
> 		"
> ...]

See: http://interchange.rtfm.info/icdocs/tags/search-region.html and 
http://interchange.rtfm.info/icdocs/Search_parameters.html.

> I think I figured out that "sf" is the argument name, "se" is the value, and "op" is the operation which connects the two. So the code above reads as "deleted ne 1" and "status eq pending_approval".

Close, see the second link above for documentation on these args.

> What I am trying to do is display orders that have the status "pending_approval" as well as "pending_payment". My approach to this was to do a regular expression for status, such as...
> 
> sf=status
> se=/pending_approval|pending_payment/
> op==~
> 
> (status =~ /pending_approval|pending_payment/)
> 
> The =~ operator works fine if I just compare a phrase, such as "pending_payment", but does not return anything if I try to compare it to a regex.
> 
> My question is, is what I'm trying to do not possible? Can I not pass a regular expression as the value to an argument? Or am I not passing the regex in correctly?
> 
> I've tried quotes, single quotes, and a few other things when passing the regex.

Remove the leading and trailing "/".  Also see 
http://interchange.rtfm.info/icdocs/Interchange_search_engine.html#Coordinated_and_joined_searches 
for more info.


Peter


More information about the interchange-users mailing list