Out of Stock Search
Miso's Search Engine can help you fine-tune search results based on inventory level and suggest semantically similar items for your customers when certain products are out of stock.
Introduction
Suppose a customer searches for a product on your site, only to find it is out of stock. This is a frustrating position to be in - from both a consumer and retailer point of view.
The customer may abandon their search completely or visit a competitor’s site to find what they’re looking for, even if your site has many comparable substitutes waiting to be discovered. Therefore, it would be helpful to de-rank out of stock products in search results (or hide them completely) and up-rank semantically similar products that are in stock.
In this article, we’ll take a look at techniques you can employ on your site to drive conversions, even when certain products are out of stock.
Before implementing Out of Stock Search:
After implementing Out of Stock Search:
Do it with APIs
Handling Out of Stock search scenarios simply requires two steps: (1) sending product inventory data to Miso and (2) enabling semantic search
Sending product inventory data to Miso
You can periodically upload inventory data to Miso with the Products API, using any upload schedule that makes sense for your business. The availability
field in the product catalog can be updated with values such as "IN_STOCK"
or "OUT_OF_STOCK"
. You can also create a custom attribute such as "custom_attributes.inventory_amt" : int
to track the exact quantity available.
Here’s a sample request for updating inventory data, using both the availability
field and a custom attribute called inventory_amt
.
//Sample Request
POST /v1/products
{
"data" : [
{
"product_id" : "Sony_PS5_Digital",
"availability" : "OUT_OF_STOCK",
"custom_attributes" : {
"inventory_amt" : 0
}
}
]
}
There are several key benefits to sending inventory updates to Miso:
- Fewer API calls - By consolidating inventory data, you can make fewer API calls when loading web pages and create a more responsive browsing experience for your customers.
- Train your engine - Have Miso’s search engine account for inventory data during training to rank items lower if they’re out of stock.
- Strategically merchandise based on inventory - Miso supports various merchandising tools, such as filtering, boosting, and anchoring, to fine-tune your product recommendations based on inventory level.
Use Semantic Search to show similar products
Rather than have a customer abandon their search if the exact product they’re looking for is out of stock, enable Semantic Search to return products that are contextually similar to the search query, even if they don’t share any keywords. For example, a customer searching for kleenex is likely to be interested in other brands of facial tissues as well.
Enabling Semantic Search requires just two parameters - enable_partial_match
and enable_semantic_search
. Here’s an example of a customer searching for a gaming console - “ps5”, using semantic search:
//Request
POST /v1/search/search
{
"q" : "ps5",
"user_id" : "user-123",
"enable_partial_match" : true,
"enable_semantic_search" : true
}
//Response
{
"data" : {
"products" : [
{
"product_id" : sony_ps5_disk
"availability" : "OUT_OF_STOCK"
},
{
"product_id" : sony_ps5_digital
"availability" : "OUT_OF_STOCK"
},
{
"product_id" : xbox_series_s_500gb
"availability" : "IN_STOCK"
},
{
"product_id" : nintendo_switch_oled
"availability" : "IN_STOCK"
}
],
"total" : 15
}
}
Although both Playstation 5 models are out of stock, Miso's Search API will return semantically similar items - the Xbox and Nintendo Switch - which are comparable substitutes for someone looking to play video games.
For more information on Semantic Search, check out our Semantic Search Recipe.
Tips and Tricks
- If you’d like to entirely remove out of stock products from appearing in search results, you can filter the results using the
fl
parameter. For more information on filtering, check out our Filtering Recipe.
Additional Resources
For more information on Miso’s Search API, check out the official API Documentation.
For more recipes like this, visit the Recipes page on our Docs site.
Published Date: March 17th, 2022
API Reference
Need more info on the API? Check out our dedicated API page with all the info you could ever want.
Read API Reference