I have customized the solar query so that it returns me the response in each fulfillment center for a particular product (say chair) as
inventory_11051======>10
inventory_11052======>0
etc
I need to add a filter in the front end so that my solar results are filtered to show only those products which has inventory greater than 0.
Please note: 11051 and 11052 are fulfillment ids which I should decide at run time and append to the filter. Can someone please help me on the same?
Cheers!
I gathered from your question that you have a number of inventories you have to check? So you need to return fulfillment IDs for product X where inventory is greater than zero? I assume then that product ID plus fulfillment ID is the unique key for your index?
If so then filtering for inventory should not be a problem. Inventory is an integer, right? So to filter on inventory you would simply add " inventory:[1 TO *] " to your filter query parameter ("fq" if you're using the Solr web service). Filtering on fulfillment IDs should work similarly, except you won't be using a range: " fulfillment_id:(11051 OR 11052) ". Does that help? Remember to use a "+" before each filter if you have multiple filter params. So your filter query may look like this: "fq=+inventory:[1 TO *] +fulfillment_id:(11051 OR 11052)".
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.