Good use of synonyms is essential for providing a positive search experience. In this article we take a quick look at when and how you implement them. Whether you’re using our playboard or coding your own dashboard, after reading this, you should be ready to start playing with our Synonymize feature.

What is a synonym?

A synonym is a word or phrase that has the same meaning as another word of phrase from the same language. When talking about search , synonyms are used to remove distance between the way products are named and the way users search for them.

When should I use synonyms?

If you navigate to the Queries page of your playboard, you are able to access a variety of data regarding queries made on your site. This data ranges from general query performance to the most clicked products related to specific queries. However, for the purposes of this exercise, we will be focusing only on the No-Results Queries tab.

Within this tab, you will see any and all queries entered on your site that have returned no results. These queries need to be analysed in order to understand how to convert them into successful searches, but connecting synonyms is usually a good place to start. Let’s look at an example… Imagine that you have suitcases in your catalogue. In the image above, you can see that one query that has no results is ‘ luggage’. Our goal will be to connect all users that search for ‘ luggage’ with the results for the query ‘ suitcase’ . Using synonyms is how we will achieve this goal.

How do I create a synonym using the playboard?

Creating synonyms is really straightforward. Navigate to the Synonymize page of the playboard. Click New to open the New Synonym form. The form has the following fields:

  • Synonyms : List of all related terms here. In this case, ‘luggage’ and ‘suitcase’.
  • Lang : Select the language these terms are in from a dropdown menu.
  • Type : By default you can choose from colour or basic, (you are able to add additional types if you wish). We are not defining related colour terms, so we will select basic.
  • Enabled : Choose whether or not you wish to enable these synonyms. We want them active straight away so we tick the box.

Just click Save when you are finished and your synonyms will be active.

How to create a synonym using Play API?

If you want integrate our features in your own dashboard, you could create synonyms using our public Play API . It’s really easy. For example, if you were using Python, you could do something like this:

    import requests, logging
    # login using user service to get a valid token
    user_request = requests.post('https://api.empathybroker.com/user/v1/user/login',
    json={'email': 'YOUR_EMAIL', 'password': 'YOUR_PASSWORD'})
    if user_request.status_code != 200:
    logging.error('Error %s requesting user token: %s', user_request.status_code, user_request.text)
    return
    login = user_request.json()
    logging.info('Login succeeded')
    data = {
    "synonyms": ["luggage", "suitcase"],
    "lang": "en",
    "type": "basic",
    "enabled": True,
    "extra": {
    "user": "myemail@company.com"
        }
    }
    # create a synonym requesting play service
    synonym_request = requests.post('https://api.empathybroker.com/play/v1/YOUR_INSTANCE/synonyms',
    json=data,
    headers={'Authorization': 'Bearer ' + login['user_token']})
    if synonym_request.status_code > 299:
    logging.error('Error %s creating synonym: %s', synonym_request.status_code, synonym_request.json())
    return
    logging.info('Synonyms created %s', synonym_request.json())

In summary

Synonyms help avoid those dreaded no-results pages. Knowing how and when to implement them is essential for a well-tuned search experience. To find out more about Synonyms and User endpoints refer to the API documentation for your environment or read more in our blog here .

If you’re unsure about the best way to utilise synonyms, don’t hesitate to contact us. It’s a key part of the search experience, so we’ll be happy to guide you through.