Proxima Bridge Query with OR

amartins
@amartins
7 years ago
48 posts
Hello!
I am trying to perform a search in a collection with OR, but I don't know how to do it or if it is possible.
First I'll explain what I need to achieve. I have a tri-state variable with possible values being disabled, enabled and always. When this var state is enabled I need to check a valid timestamp of another variable. For this purpose let's define var1 the tri-state and var2 the timestamp. I need a list of valid items as followed:
items = (var1 == always || (var1 == enabled && var2 >= currDate)), where currentDate is a timestamp.
Using search operation with Proxima bridge the only way I can see to achieve this is by performing two requests:
···/search?search1=var1 eq enabled
then
···/search?search1=var1 eq enabled&search2=var2 gte 1503068018

Is there a way to perform this in a single request?

updated by @amartins: 12/09/17 08:57:45AM
michael
@michael
7 years ago
7,646 posts
Docs: "Searching with OR"
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/89/jrcore-list#searching-with-or
search1="user_instrument = guitar || user_instrument = drums"

But the search from proxima bridge arrives at jrProximaBridge_search_items() which isn't setup to look for the || in the search.

I'll add it as an improvement suggestion for lack of other way to do it right now.
michael
@michael
7 years ago
7,646 posts
I've added some code in that I think fixes this issue, will see if it passes inspection
amartins
@amartins
7 years ago
48 posts
Thanks Michael.
serveion
@serveion
7 years ago
223 posts
hello @michael

Thank you, I just got the update notification about the changes in proxima
michael
@michael
7 years ago
7,646 posts
This is in the marketplace now:
https://www.jamroom.net/proxima/networkmarket/242/proxima-bridge?expanded_changelog=1

Quote:
Proxima Bridge module changelog

Version 1.1.5: - Change: Support added for "OR" option in searches when doing a GET search
...

Tags