
AI search is not difficult tool to use, especially when we use one language. A lot of our customers are operating in many markets and want to use search in different languages. It is hard to avoid a situation where a user enters a different language when searching certain categories in his language on the website. We can accept it and the fact that he will find a blank page with no results, but on the other hand we can set up the search process and, based on that, show him the products he is looking for no matter which language he uses.  

**Challenge**

Our client had one e-commerce platform that uses different variants depending on the region chosen by customers, currencies available on the chosen region and website language. Additionally, each market had its own product stock. So, in fact we had several e-commerce operations under one domain.  

Our customer wanted to have all the data in one place and execute all campaigns from the one place as well. He was also interested in creating AI search which makes it possible to search for products in different languages.  

![Screenshot presenting ai search](/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/aisearch-products1.png)

## Prerequisites 
---
- Synerise [tracking code](/docs/settings/tool/tracking_codes), to collect all necessary events from the website.
- [Product feed](/developers/product-feed) implemented.
- [OG tags](/developers/web/og-tags).
- Collecting [transactional events](/docs/automation/actions/synerise-integrations/import-events).

## Process
---
1. [Prepare product feeds](/use-cases/search-multiple-languages#prepare-product-feeds) for each market.
2. [Prepare a search ranking](/use-cases/search-multiple-languages#prepare-a-search-ranking).
3. [Set up AI search](/use-cases/search-multiple-languages#set-up-ai-search) - query rules and synonyms.

## Prepare product feeds
---
1. **Create separated product feeds** for each market with additional information about those languages on the website which we want to use in our search - every attribute like description, title, type, category should be added in two languages. Everything in the Google merchant format. Thanks to that, even if the customer is on the English version of the website, he can search using Arabic words as well.  
<br></br>

2. Every search for each region has to be built on the basis of separate product feeds. So, we have to prepare **different indexes for such an AI search**. Thanks to that we can choose, based on which product feed we want to build our models on. As you can see below, we can choose one of the imported product catalogs and later use it to prepare the appropriate campaign. 

   ![Screenshot presenting index](/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/indexes.png)

## Prepare a search ranking
---
In the case of a search engine, the most important step of setting it up is to **prepare a search ranking**. This means you have to indicate which attributes around the product have to be searchable and assign their importance.  

   ![Screenshot presenting ranking](/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/aisearchranking.png)

   As you can see here, we have a lot of attributes from the product feed, from this customer, but the most important are searchable attributes which will be search at the beginning. In our case it will be: 

    - Category  
    - itemID 
    - attributes.product_type_ar – second language 
    - brand 
    - title 

   In medium and low importance, we have also the next attributes from the product; description, gender, attributes.title_ar, attributes.description_ar, and more of them in the low importance (e.g. size, pattern etc.). 
<br></br>

## Set up AI Search 
---
### Query rules

Synerise lets you optimize search using our query rules. It also allows us to prepare seven better search results. 

Based on this, in just a few steps you can decide that if somebody enters a query, you can replace it with a different phrase and show him specific content. 

We can prepare such query rules in AI Hub – Indexes - New index, clicking button “create new” in query rules.  
 

We have to complete 3 sections: 
- Conditions  
- Consequences 
- Schedule  
 
![Screenshot presenting query rules](/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/queryrules.png)

Let’s say that we want to prepare a query for when someone enters “dress” - we would like to show him products from the dress category in the Arabic language “فستان”. 

So, we choose the title from the first steps subpage and add it to the consequences section. In this way we will define that if somebody enters “dress” we would like to replace this query with a new query, which is dress in Arabic.  

### Synonyms

You can also use synonyms to make the search more effective. To do this, add new synonym in the synonym section. Choose if it should work in one way or two ways.  

![Screenshot presenting query rules](/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/synonyms.png)

It can be helpful if a lot of similar words for your category exist (sweatshirt and hoodie) or a lot of different products are in the same category e.g. beach accessories, where you can find towels, bags, umbrellas etc.  


<div class="admonition admonition-tip"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" /></svg></div><div class="admonition-body"><div class="admonition-content">

You can always check the **zero page results section** in your search configurator to see what kind of words are often entered by your customers. It may be that some categories or product names are entered by mistake and you can automatically replace them with the proper word.

</div></div></div>



## Read more
---
- [AI search](/docs/ai-hub/ai-search/introduction-to-ai-search)
- [Catalogs](/docs/assets/catalogs/creating-catalogs)
- [Product Search API documentation](https://developers.synerise.com/AISearch/AISearch.html)
