Product-recipe matching for enhanced culinary experience
Today’s customers are fans of convenience and are looking for quick and efficient solutions to meet their needs. When it comes to food, customers usually purchase products with a specific dish in mind or look for inspiration to create a delicious meal.
By matching products with recipes and vice versa, businesses can inspire customers to purchase the products needed for their next culinary adventure while also providing them with creative recipe ideas. This approach not only increases the average order value, but it also enhances the overall shopping and cooking experience. By seamlessly integrating shopping and recipe discovery, businesses can provide a more intuitive and satisfying experience for their customers, ultimately leading to increased loyalty and revenue growth.
![Product-recipe matching cover graphics](/use-cases/all-cases/_gfx/look-and-cook-main-graphic.png)
This use case illustrates a scenario in which product and recipe information are linked to each other. As a result, we achieve a scenario where the product page displays recipes featuring the viewed product, and the recipe page displays the products required to prepare the described dish. This approach enhances the user experience on the site and promotes up-selling, ultimately leading to an increase in the average order value.
We have created an interactive web page that demonstrates the described solution in a practical manner. This page showcases the relationship between ingredients and recipes, with all the necessary ingredients conveniently listed on recipe pages and vice versa. You can easily navigate to each ingredient from the recipe page and explore other recipes that utilize the same ingredient. Check out the page now!
Prerequisites
- Implement Synerise web SDK.
- Implement OG Tags on your website.
- Import product feed into the Synerise catalog
Note:
In this use case, we use two separate product feeds:
- A standard product feed (A) - which additionally contains an itemId array with recipes that match the product. In our example, we use the c:recipesHandle parameter.
- An additional feed with recipes (B) - which contains an array of itemId of products from the previous feed needed to make the recipe. In the example, we use the c:productsHandle parameter.
Prepare two search indexes
Create two separate search indexes for ingredients and recipe catalogs.
We will start by creating an index for the ingredients catalog.
-
Go to
AI Search > Indexes.
-
Click Add index.
Result: The index creation screen opens. -
In the Index name field, type the meaningful name of the index.
- From the Choose catalog dropdown list, select an item catalog to use as the source for the search results.
WARNING: Remember that the value of an item attribute in the item catalog cannot be longer than 1000 characters. It applies both for creating a new index and updating it. - From the Choose search engine language dropdown, select the language of your search engine.
- From the Choose catalog dropdown list, select an item catalog to use as the source for the search results.
-
Click Next step.
Example of basic index settings -
Define response and searchable attributes. More detailed information about these attributes can be found here.
-
Click Next step.
Result: The Filters & Facets screen opens. -
Define filterable and facetable attributes. More information about these attributes can be found here.
-
Click Next step.
Result: The Ranking screen opens. -
Click Complete.
-
Wait until the index is ready. Refresh the page until you receive information in the upper right corner of the screen that the index is ready.
Note: The time required to prepare the index depends on the size of the feed and can range from 5 minutes to 2 hours.Your index is ready -
Check the performance of the filters in the Preview tab.
-
In the search field, enter the name of the product.
Result: A list with the defined search results appears.Preview of inngredient catalog -
Create a recipe search index. Follow the same instructions as described for the product index.
Implement a solution on your site
According to the Synerise API Reference documentation and the description of how to construct filters for Filters queries, you can use Synerise Search to expand the page using two scenarios:
- when you are on the recipe page, show the required ingredients,
- when you are on the ingredient page, show the related recipes.
Display the required ingredients on the recipe card
An example of cURL request:
curl 'https://api.synerise.com/search/v2/indices/8f3a20c375803e5807244e6bbc803fea1688306195/list?token=FEE539C0-D206-A685-88F8-0E433FCDFD1D&clientUUID=bbe22634-0105-41f3-ad7f-b2766071a012&limit=26&filters=itemId%20IN%20%5B%22100019%22,%22100010%22,%22100016%22,%2210006%22,%2210003%22,%2210001%22,%2210008%22,%22100023%22%5D'
Explanation of the respective elements of the request:
https://api.synerise.com/search/v2/indices/8f3a20c375803e5807244e6bbc803fea1688306195/list
token=FEE539C0-D206-A685-88F8-0E433FCDFD1D
clientUUID=bbe22634-0105-41f3-ad7f-b2766071a012
filters=itemId IN ["10001","10006"]
- token: the token parameter contains the authentication UUID (tracker key) that gives access to API,
- clientUUID: the parameter contains the identifier of the customer for which the request is sent,
- filters: is a parameter that specifies the criteria by which the elements should be retrieved. In this case, we are looking for items whose title matches one of the values in the array (10001, 10006). In other words, with itemId we retrieve the ingredients from which we can prepare the meals we are currently reviewing.
Show related recepies on the ingredient page
An example of cURL request:
curl 'https://api.synerise.com/search/v2/indices/0036645cd9413eccbd31877a8c967e991688311535/list?token=FEE539C0-D206-A685-88F8-0E433FCDFD1D&clientUUID=bbe22634-0105-41f3-ad7f-b2766071a012&limit=26&filters=itemId%20IN%20%5B%2230003%22,%2230004%22,%2230005%22,%2230007%22,%2230009%22,%2230000%22,%2230001%22,%22300010%22,%22300011%22,%22300012%22,%2230002%22,%2230006%22%5D'
Explanation of the respective elements of the request:
https://api.synerise.com/search/v2/indices/0036645cd9413eccbd31877a8c967e991688311535/list
token=FEE539C0-D206-A685-88F8-0E433FCDFD1D
clientUUID=bbe22634-0105-41f3-ad7f-b2766071a012
filters=itemId IN ["30001","30002"]
- token: the token parameter contains the authentication UUID (tracker key) that gives access to the API,
- clientUUID: the parameter contains the identifier of the customer for which the request is sent,
- filters: is a parameter that specifies the criteria by which the elements should be retrieved. In this case, we are looking for items whose title matches one of the values in the array (30001, 30002). In other words, with itemId we retrieve recipes for meals we can prepare from the ingredient we are currently viewing.
Check the use case set up on the Synerise Demo workspace
You can check all the analytics directly in the Synerise Demo workspace: