Mailing List Archive

search-region.coretag
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
"
...]


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".

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.

As always, any help is much appreciated. Thank you for your time.

______________________

Mihai Dan
Air Delights, Inc.
https://www.airdelights.com
1 (800) 440-5556

_______________________________________________
interchange-users mailing list
interchange-users@interchangecommerce.org
https://www.interchangecommerce.org/mailman/listinfo/interchange-users
Re: search-region.coretag [ In reply to ]
On 9/12/20 11:11 am, mihai@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
_______________________________________________
interchange-users mailing list
interchange-users@interchangecommerce.org
https://www.interchangecommerce.org/mailman/listinfo/interchange-users
Re: search-region.coretag [ In reply to ]
Thank you very much Peter. I will look into this.

______________________

Mihai Dan
Air Delights, Inc.
https://www.airdelights.com
1 (800) 440-5556

-----Original Message-----
From: "Peter" <peter@pajamian.dhs.org>
Sent: Wednesday, December 9, 2020 4:59pm
To: interchange-users@interchangecommerce.org
Subject: Re: [ic] search-region.coretag

On 9/12/20 11:11 am, mihai@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
_______________________________________________
interchange-users mailing list
interchange-users@interchangecommerce.org
https://www.interchangecommerce.org/mailman/listinfo/interchange-users


_______________________________________________
interchange-users mailing list
interchange-users@interchangecommerce.org
https://www.interchangecommerce.org/mailman/listinfo/interchange-users