0

The Best Buy Search allows to search products specifying weight , depth , length and using < and > operator. For example:

weight<4

However it seems that the API is using alpha sorting rather than actual numeric values comparison for those fields and operators.

for example it will consider that 11 < 4

Are there any way to force the API to properly evaluate those conditions ?

PBK101
  • 3
  • 1

1 Answers1

0

The "weight" attribute in the API is a string field that contains both the value and the unit of measure. The unit of measure may differ per product. So it is not possible for the API to evaluate the "weight" attribute numerically in searches and sorting.

However - there is also a "shippingWeight" attribute in the API, which IS evaluated numerically and the unit of measure is pounds. When searching and sorting by "shippingWeight", the API will treat the value numerically. Of course, "shippingWeight" is not the same as the raw "weight" attribute - but I hope it will be sufficient for your use case.

tcox5698
  • 111
  • 2
  • what about depth height and width ? the API doc states these are inches so it should be able to evaluate those numerically. Also I have yet to see a product whose weight is in anything else than in lbs. – PBK101 Nov 26 '14 at 23:38
  • Some dimension attributes behave the same as "weight" - that is, they contain the value and the unit of measure concatenated together. However - there are several attributes that express the unit of measure in the attribute name. These are some examples: heightToTopOfDoorHingeIn, subwooferSizeIn (the postfix "In" in these attribute names indicates the unit of measure is inches). In those cases where the unit of measure is expressed in the attribute name, the value of the attribute will be treated numerically by the API. – tcox5698 Dec 01 '14 at 14:52