Safe Search
With Miso Safe Search, automatically filter age-restricted items from appearing in your search results, unless explicitly searched.
Introduction
If your e-commerce site has a diverse catalog, including age-restricted items such tobacco, alcohol, and sexual health products, you may not want those age-restricted items to appear in product search results, unless explicitly searched.
For example, suppose a customer searches for “cinnamon” on a grocery site and sees the following search results:
Although all three items technically match the search criteria, it’s likely that the user’s intent is more “family-friendly” and that they don’t want to see alcohol in the search results. However, if the user had explicitly searched for “cinnamon whisky”, it would make sense for the Fireball product to be shown.
In this article, we’ll discuss how Miso’s Search Engine can be fine-tuned to allow for context-switching between “family-friendly” and “adult” products.
Do it with APIs
To enable Safe Search on your Search Engine, you will need to provide your Miso Support team with a .csv file containing a list of categories that contain “adult” products. And stay tuned - Safe Search management is an upcoming update to Dojo.
Next, set the enable_safe_search
parameter to true
in your API request body.
From our previous example, a customer searches for “cinnamon”, but with Safe Search enabled, only products in the “pantry” and “breakfast” category are returned.
//Sample Request
POST /v1/search/search
{
"q" : "cinnamon",
"user_id" : "user-123",
"enable_safe_search" : true
}
//Sample Response
{
"data" : {
"products" : [
{
"product_id" : "mccormick_grnd_cinnamon"
"categories" : ["Pantry", "Spices and Seasonings"]
},
{
"product_id" : "pillsbury_cinnamon_rolls_original"
"categories" : ["Breakfast", "Donuts and Pastries"]
},
{
"product_id" : "kellogg_pop_tarts_cinnamon"
"categories" : ["Breakfast", "Donuts and Pastries"]
}
],
"total" : 10
}
}
On the other hand, if the customer searches for “cinnamon whisky”, they will see the relevant product, even with Safe Search enabled.
//Sample Request
POST /v1/search/search
{
"q" : "cinnamon whisky",
"user_id" : "user-123",
"enable_safe_search" : true
}
//Sample Response
{
"data" : {
"products" : [
{
"product_id" : "fireball_hot_cinnamon_whisky"
"categories" : ["Beer, Wine, and Liquor", "Spirits and Liquor"]
}
],
"total" : 1
}
}
Additional Resources
For more information on Miso’s Recommendation API, check out the official API Documentation.
For more recipes like this, visit the Recipes page on our Docs site.
Published Date: April 1st, 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