All,

I'm trying to create a query that returns results if an item matches
the specified UPC OR if it matches the specified text.  However, I
want to sort the results so that items with matching UPC are displayed
first.

I have come up with the following query but I am getting an error back
from the API.

snippets?bq=[upc(text): "885909174966"]|"Apple MacBook Pro"&orderby=
[x=upc(text): if exists(x) then (if "885909174966" == x then 1 else 0)
else 0]

Returned:
<errors>
  <error type="request" reason="Invalid expression: malformed
expression: (&quot;885909174966&quot; == x); expected operand of type
text, but found upc(text)"/>
</errors>

Can I not test a variable (x in this case) for a given value?

Thanks!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Base Data API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Base-data-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to