Partial MatchWIP
Help users find what theyβre looking for by returning search results that partially match keywords in their query

Introduction
By default, Misoβs Search engine returns products or content based on matching of all keywords. For example, if a customer shopping for shoes searches βblue Nike dunk lowβ, only products containing all four keywords: βblueβ, βNikeβ, βdunkβ, and βlowβ would be returned. This can lead to highly relevant search results but also risks returning few results or an empty page if the product catalog doesnβt have exactly what the customer is looking for.
By using Partial Match, you can relax the search criteria to return products that only match some of the search keywords, thereby increasing the search recall.
Do it with APIs
To enable Partial Match within Misoβs Search API, simply set the enable_partial_match
parameter to true
in the request body.
Additionally, you can modify the response by setting values for partial_match_mode
and enable_partial_match_threshold
:
partial_match_mode
Choose from blended (default) or separated.
- Blended: When
partial_match_mode
isblended
, keyword-matched items and semantically-matched items will be returned in the same, rank-sorted array. - Separated: When
partial_match_mode
isseparated
, keyword-matched items will be returned in aproducts
array and semantically-matched items will be returned in apartially_matched_products
array. A scenario where this is useful is if you only want to show semantically-matched products when the keyword-matched products are out of stock or not in your product catalog.
enable_partial_match_threshold
If partial_match_mode
is set to separated
, you can optionally provide a value for the partial match threshold. This parameter, which accepts an integer
, informs Misoβs Search Engine when to provide partially matched results. For example, if we set "enable_partial_match_threshold" : 3
, partially matched results will only be returned when there are three or fewer exact keyword matches. By default, the partial match threshold is set to 5
.
Letβs revisit our earlier example of shopping for shoes. Suppose we have a product catalog with the following items:
Without partial match enabled, if a user searches for βblue Nike dunk lowβ, a single product from the catalog would be returned, since only βNike Dunk Low βUniversity Blueββ matches all four keywords: βblueβ, βNikeβ, βdunkβ, and βlowβ.
Request:
POST /v1/search/search
{
"q" : "blue Nike dunk low",
"user_id" : "user-123",
}
Response:
{
"data": {
"products": [
{
"title": "Nike Dunk Low - University Blue"
}
],
"total": 1
}
Now letβs enable partial match, set the partial match mode to blended, and set the threshold to 5. In our example there is only one exact match, so we should expect to see partially matched products in a separate array. The partially matched results are ordered by relevancy to the user.
Request:
POST /v1/search/search
{
"q" : "blue Nike dunk low",
"user_id" : "user-123",
"enable_partial_match" : true,
"partial_match_mode" : "separated",
"enable_partial_match_threshold" : 5
}
Response:
{
"data": {
"products": [
{
"title": "Nike Dunk Low - University Blue"
}
],
"total": 1
"partially_matched_products": [
{
"title": "Nike Dunk Low - Goldenrod",
"_missing_keywords": ["1"]
},
{
"title": "Nike Dunk High GS - White Midnight Navy",
"_missing_keywords": ["2"]
},
{
"title": "Yeezy Boost 350 V2 - Dazzling Blue",
"_missing_keywords": ["3"]
}
]
}
Now we are returning three additional products that share keywords with the search query and are likely to be relevant to the user.
Tips and Tricks
- Before implementing partial match via API, you can visually preview the results with Dojo. Open the Advanced Settings pane in the Search Engine Sandbox and enter an integer value in the βENABLE_PARTIAL_MATCH_THRESHOLDβ box to get started.
- To return a broader set of products that are related to the search terms, enable the semantic search parameter to have Misoβs search engine perform semantic analysis on the userβs query. For more information, see the Semantic Search 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