[英]Custom ranging in solr for custom field with websphere commerce
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 库存_11051 ======> 10
inventory_11052======>0 库存_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. 我需要在前端添加一个过滤器,以便对太阳能结果进行过滤,以仅显示库存大于0的产品。
Please note: 11051 and 11052 are fulfillment ids which I should decide at run time and append to the filter. 请注意:11051和11052是应实现ID,我应该在运行时决定并将其附加到过滤器中。 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?
因此,您需要返回库存大于零的产品X的履行ID。 I assume then that product ID plus fulfillment ID is the unique key for your index?
我认为产品ID和履行ID是索引的唯一键吗?
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).
因此,要对清单进行过滤,您只需在过滤器查询参数(如果使用的是Solr Web服务,则为“ fq”)中添加“库存:[1 TO *]”。 Filtering on fulfillment IDs should work similarly, except you won't be using a range: " fulfillment_id:(11051 OR 11052) ".
对实现ID的过滤应该以类似的方式进行,除非您将不使用范围:“ fillment_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)".
因此,您的过滤器查询可能看起来像这样:“ fq = +库存:[1 TO *] + fulfillment_id:(11051 OR 11052)”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.