Getting Started with Personalized Search
Personalized Search is an essential feature for any marketplace. It helps users find exactly what they're looking for, so they don't give up and go search for the product on another site.
Introduction
In this guide, we’ll discuss:
- Defining personalized search
- Customizing personalized search using Recipes
- Implementing personalized search using APIs
What is personalized search?
Personalized search uses deep learning to connect users’ queries to results that are uniquely relevant to them. Unlike traditional search engines that retrieve and rank results solely based on term frequency, Miso’s Search Engine performs real-time relevancy ranking through the lens of a user’s own interests, preferences, and site interactions.
For instance, consider the various search results for “milk” on an online grocery store. Miso’s Search Engine learns that a customer who has an affinity for organic produce should see organic milk cartons at the top of their page and that a customer who has previously purchased dairy alternatives should see soy milk or oat milk in their results instead.
Using personalized search, two customers searching your e-commerce site may see different results for the same query – a paradigm shift that typically generates a 15-20% higher conversion rate for our partners (when compared to traditional search engines).
Customizing Personalized Search Using Recipes
Miso’s Search Engine is highly customizable - from incorporating merchandising strategies to layering mathematical functions for product rankings, our mission is to give you full control of the search experience.
All these features can be integrated to provide a comprehensive search experience. Recipes are a great way to familiarize yourself with how Miso’s Search Engine can be leveraged on your site. Here are some recipes to get started:
Implementing Personalized Search using APIs
Basic Usage
Miso’s Search API provides personalized, typo-correcting search for your site. Simply send the user’s queries to the search
endpoint and the API will return the relevant results tailored to the user.
As a basic example, suppose a user searches for “jeans”. The API request would look like the following:
POST /v1/search/search
{
"q": "jeans",
"user_id": "user-123"
}
In order to make accurate predictions, we require that you send the search query - q
, along with the user id - user_id
to the Search API at minimum. If a user is not signed in, you can alternatively send an anonymous_id
(such as a hash of their IP address). If they eventually sign in, we will automatically reconcile their interaction data with their permanent profile.
The response would look something like this:
{
"message":"success",
"data":{
"took":50,
"total":30,
"start":0,
"miso_id":"f34b90de-086b-11eb-b498-1ee8abb1818b",
"products":[
{
"product_id":"505-regular-fit-mens-jeans",
"title":"The 505 Regular Fit Men's Jeans",
"url":"https://levi.com/jeans/505-regular-fit-mens-jeans/",
"size":"29",
"material":"Cotton",
"color":"Rinse - Dark Wash",
"_search_score": 78.12,
"_personalization_score": 0.98
}
],
"spellcheck":{
"spelling_errors":false
}
}
}
The Flexibility of the Search API
Miso’s Search API can be highly customized - by implementing merchandising strategies, facet-filtering, diversification, and more.
For a more comprehensive example, let’s send the Search API the following request:
POST /v1/search/search
{
"q": "jeans",
"user_id" : "user-123",
"rows" : 10,
"fq" : "custom_attributes.gender:\"M\"",
"boost_fq" : "brand:\"Levi's\"",
"enable_semantic_search" : true
}
The search request will return 10 results (rows
), be filtered to only include results that match a custom attribute from your product catalog (fq
), boost results from Levi’s (boost_fq
), and expand the query to include semantically similar terms like “denim” (enable_semantic_search
). As you can see, including additional parameters in the API request body can tailor results for your business.
Automatic Spellcheck
Spellcheck is on for every search request by default. Unless explicitly specified, Miso will replace misspelled words in a user’s query before running it against your product catalog. For example, suppose a user searches for “whte denem jeans”. The API request would look like the following:
POST /v1/search/search
{
"q":"whte denem jeans",
"user_id":"user-123",
"spellcheck":{
"enable_auto_spelling_correction":true
}
}
The API response would look like:
{
"message":"success",
"data":{
"took":50,
"total":30,
"start":0,
"miso_id":"f34b90de-086b-11eb-b498-1ee8abb1818b",
"spellcheck":{
"spelling_errors":true,
"auto_spelling_correction":true,
"original_query":"whte denem jeans",
"original_query_with_markups":"<mark>whte</mark> <mark>denem</mark> jeans",
"corrected_query":"white denim jeans",
"corrected_query_with_markups":"<mark>white</mark> <mark>denim</mark> jeans"
},
"products":[
...
]
}
}
Conversely, if enable_auto_spelling_correction
is set to false
, the user’s query will be used as-is, without any spelling corrections.
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.
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