Search Bias
The search portion of the API is considered BETA and is subject to change at anytime. Updates/Changes will be announced via our blog.
What does it do?
What does it do?
The search bias portion of the API allows you find the products you are looking for in a more accurate and better way. Through the features you can get relevancy results or a custom search using biased results.
The Product API
Base URL: http://api.remix.bestbuy.com/{version}/products
Curent Version: V1
HTTP Method: GET
Base URL: http://api.remix.bestbuy.com/{version}/products
Curent Version: V1
HTTP Method: GET
Default Queries:
If you run a query without setting the optional parameters, this is what happens:
Attributes
Each query URL will have required and optional parameters that must be included to complete a query.
| Parameters | Required | Options |
|---|---|---|
| apiKey | yes | String Value For more information, see Requesting a Key. |
| format | no | String Value json or xml |
| page | no | Positive Integer Value |
| show | no | String Value Specify string of "all" or Product Attributes Example: sku,name,url Comma delimited |
| sort | no | String Value Attribute.{SORT METHOD} Methods: desc, asc |
Before
Let's say you want pink and green ipods in a pre-search world. You'd have to say something very "literal" and exact like:
But pre-search you couldn't say something like, give me all ipods but I *prefer* pink and green ones, now you can.
| Before Examples |
|---|
| #1 Give me all Ipods that match pink and green. http://api.remix.bestbuy.com/v1/products(name=ipod*&(color=pink|color=green))?show=name,color&apiKey={APIKeyHere} |
But pre-search you couldn't say something like, give me all ipods but I *prefer* pink and green ones, now you can.
Now
"Operation Bias", aka Term Boosting
This is what we refer to as relevance ranking. You'd like to say that I want all Ipod's, but that pink and green products are more "relevant".
This is what we refer to as relevance ranking. You'd like to say that I want all Ipod's, but that pink and green products are more "relevant".
| Operation Bias Examples |
|---|
| #1 Give me ipods of any color, but prefer pink by a factor of 2, and green by a factor of 4. http://api.remix.bestbuy.com/v1/products(name=ipod*&(color=*|bias(color=pink,2)|bias(color=green,4)))?show=name,color&apiKey={APIKeyHere} |
"Value Bias"
Now I want all ipod-related items, but I want to cause more expensive products to be closer to the top (which you could also accomplish via a sort, but bear with us):
This is what we call a "Value Bias" - you want to use the value of a product's salePrice to weigh on its relevance.
Now a combo of using Operation and Value Bias.
You can also devalue products in a Value Bias.
Dates also work in Value Bias.
Also of note is that dates can be treated as values, where the later the date is, the higher the value is.
Now I want all ipod-related items, but I want to cause more expensive products to be closer to the top (which you could also accomplish via a sort, but bear with us):
| Value Bias Examples |
|---|
| #1 Give me all Ipods and bias by salePrice. http://api.remix.bestbuy.com/v1/products(name=ipod*&bias(salePrice,2))?show=name,salePrice&apiKey={APIKeyHere} |
This is what we call a "Value Bias" - you want to use the value of a product's salePrice to weigh on its relevance.
Now a combo of using Operation and Value Bias.
| Value + Operation Bias Examples |
|---|
| #1 Give me all Ipod's but green expensive ipods are more important. http://api.remix.bestbuy.com/v1/products(name=ipod*&(bias(salePrice,0.001)|bias(color=green,4)))?show=name,color,salePrice&apiKey={APIKeyHere} |
You can also devalue products in a Value Bias.
| Devalue Bias Examples |
|---|
| #1 Give me all Ipod's but green cheap ipods are more important - note that today we express this by actually saying "expensive things are less important." http://api.remix.bestbuy.com/v1/products(name=ipod*&(bias(salePrice,-0.001)|bias(color=green,4)))?show=name,color,salePrice&apiKey={APIKeyHere} |
Dates also work in Value Bias.
Also of note is that dates can be treated as values, where the later the date is, the higher the value is.
| Date Bias Examples |
|---|
| #1 Give me all Ipod's but newer black ipods are more important. http://api.remix.bestbuy.com/v1/products(name=ipod*&(bias(startDate,1)|bias(color=black,4)))?show=name,color,startDate&apiKey={APIKeyHere} |
| #2 Older Beatles albums are more important - note that like cheap products, this is currently articulated as "newer Beatles albums are less important." http://api.remix.bestbuy.com/v1/products(type=music&(artistName=*|originalReleaseDate>1930-01-01&bias(artistName=beatles*,2)&bias(originalReleaseDate,-2)))?show=name,artistName,originalReleaseDate&apiKey={APIKeyHere} |
You have to play with the bias factors
Different attributes have different distributions of values. The attributes salePrice and startDate and color have their own sets of values across all products. You need to look at what effect a bias is having on your results and tweak the bias factor. One attribute with bias factor of 0.01 might be what you want, whereas for another, it could be 50.
