Product-recipe matching for enhanced culinary experience

Published July 14, 2023
Modules
Difficulty
Powered by
persooa logo

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

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.
Click to see a sample catalog with recipes

Example of a catalog with recipes
Example of a catalog with recipes

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.

  1. Go to AI Search icon AI Search > Indexes.

  2. Click Add index.
    Result: The index creation screen opens.

  3. In the Index name field, type the meaningful name of the index.

    1. 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.
    2. From the Choose search engine language dropdown, select the language of your search engine.
  4. Click Next step.

    Example of basic index settings
    Example of basic index settings
  5. Define response and searchable attributes. More detailed information about these attributes can be found here.

  6. Click Next step.
    Result: The Filters & Facets screen opens.

  7. Define filterable and facetable attributes. More information about these attributes can be found here.

  8. Click Next step.
    Result: The Ranking screen opens.

  9. Click Complete.

  10. 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
    Your index is ready
  11. Check the performance of the filters in the Preview tab.

  12. In the search field, enter the name of the product.
    Result: A list with the defined search results appears.

    Preview of inngredient catalog
    Preview of inngredient catalog
  13. 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:

  1. when you are on the recipe page, show the required ingredients,
  2. 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.

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:

Read more


😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker