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.

Example for Out of Stock Search

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:

ps5_out_of_stock_before.png

After implementing Out of Stock Search:

ps5_out_of_stock.png

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
Icon/Activity Icon/Add Icon/API Icon/Arrow/Down Icon/Arrow/Left Icon/Arrow/Right Icon/Arrow/TopRight Icon/Arrow/Up Icon/Bento Icon/Billing Icon/Bin Icon/Book Icon/Bookmark/Default Icon/Bookmark/Filled Icon/Calendar Icon/Caret/Down Icon/Caret/Up Icon/Chavron/DownIcon/Chavron/LeftIcon/Chavron/RightIcon/Chavron/UpIcon/Checknox/CheckedIcon/Checknox/Unchecked Icon/Checklist Icon/Chip Icon/Clipboard / Copied Icon/Clipboard/Default Icon/Clock/Stopwatch Icon/CMD Icon/Data/Catalog Icon/Data/Engine Icon/Data/Group Icon/Data/Interact Icon/Data/Users Icon/Dive Icon/Docs/Key Icon/Dojo Icon/Email Icon/Env/Development Icon/Env/Playground Icon/Env/Prod Icon/Folder Icon/Fullscreen/Collapse Icon/Fullscreen/Expand Icon/Guides/Multiple Icon/Guides/Single Icon/Hashtag Icon/Heart/Outline Icon/Heart/Solid Icon / Cart z Icon / Click Icon / Clock Icon / Data Icon / Doc Icon / EmptyCart z Icon/Social/Facebook Icon / Genome Incognito Icon / Money Icon/Social/ProductHunt Icon / Search Icon/Social/Twitter Icon / User Icon/Info/Error Icon/Info/Info Icon/Info/Question Icon/Info/Warning Icon/Interact/Download Icon/Interact/Edit Icon/Interact/External v2 Icon/Interact/External Icon/Interact/Filter Icon/Interact/Logout Icon/Interact/Options Icon/Interact/Re-order Icon/Interact/Reload Icon/Interact/Remove Icon/Interact/Replace Icon/Interact/Search Icon/Interact/Shuffle Icon/Interact/Undo Icon/Interact/Upload Icon/Interact/Video Icon/Invoice Icon/Loading Icon/Loading Icon/Lock/Locked Icon/Lock/Unlocked Icon/Lock Icon/Mapping Menu Icon/Notification Icon/Overview Icon/Person/Team Icon/Person/User Icon/Plan/Enterprise Icon/Plan/Growth Icon/Plan/Startup Icon/Plan/Trial Icon/Recipe Icon/Rocket Icon/Settings/App Icon/Settings/User Icon/Settings Icon/Shrine Icon/Sidebar/Close Icon/Sidebar/Open Icon/Slideout Icon/Sort/Ascending Icon/Sort/Default Icon/Sort/Descending Icon/Star/Filled Icon/Star/Outlined Stopwatch Icon/Support Icon/Tag Icon/Interact/Thumb/Dislike Icon/Interact/Thumb/Like Icon/Tick Icon/Trend/New Icon/Trend/Trending Icon/Tutorial Icon/Lock/Unlocked Icon/View/Grid Icon/View/List Icon/Watchlist/Add