
By preparing A/B tests in AI Search, you can find out which configuration of the AI search brings better results in terms of conversion, revenue, and CTR in your business. This use case describes an implementation that compares the results of presenting search results promoting bestsellers against personalizing the results.  

The bestsellers are selected according to item popularity, whereas personalization uses the history of a customer's activity. 

## Prerequisites
---
- Import a product feed to Synerise. You can find instructions [here](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search).
- Implement the `item.search.click` event that is generated when an item shown in the search results is clicked. Use this [API method](https://developers.synerise.com/DataManagement/DataManagement.html#tag/AI-Events/operation/publishAiCompatItemSearchClickUsingPOST).

## Process 
---

In this use case, you will go through the following steps:
1. [Prepare two search indexes](/use-cases/ai-search-ab-test#prepare-two-search-indexes).
2. [Prepare AB test](/use-cases/ai-search-ab-test#prepare-ab-test).
3. [Analyze results](/use-cases/ai-search-ab-test#analyze-results).

## Prepare two search indexes  
---
As the first part of the process, create two separate search indexes (personalization and bestseller) which will differ only in the settings of search results hierarchy.

1. Go to <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/ai-hub-icon.svg" alt="AI Hub icon" class="icon" > **AI Hub > Indexes**.  
2. Click **Add index**.  
3. Follow the instructions on the interface until the configuration of Ranking (step 4). If you need more information, you can read instruction on configuring [AI Search index](/docs/ai-hub/ai-search/create-index).  
4. Set the ranking for the personalization search index. You will create the besteller version later.
    - For the personalization search index:
        - Frequency of item page views to 70%
        - Frequency of item purchases to 0%
        - Personalization to 100%
    - For the bestseller search index:
        - Frequency of item page views to 20%
        - Frequency of item purchases to 80%
        - Personalization to 0%
5. Save the index. The index will be ready in several minutes.
    <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/ai-search-ab-test-results.png" alt="View after saving the index" class="full">
    <figcaption> View after saving the index </figcaption>
    </figure>

6. Create the bestseller search index. Apply the same settings as with the personalization search index apart from the Ranking settings.

## Prepare AB test
---
1. Go to <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/ai-hub-icon.svg" alt="AI Hub icon" class="icon" > **AI Hub > (AI Search) A/B/X Tests > New A/B test**.
2. Enter the name of the test.  
3. In the **Variants and customer allocation** section, click **Define**.  
4. Click the **Base variant** tab.  
5. From the dropdown list, select one of the indices you created in [the previous part of the process](/use-cases/ai-search-ab-test#prepare-two-search-indexes).
6. Add the next variant by clicking <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/add-variant-icon.png" alt="Plus icon" class="icon">.
7. From the **Index** dropdown list, select the second index you created in the previous part of the process. You can rename the tab for better management of the versions. 
8. In the **Customer allocation** section, assign the percentage of customers to each variant.
9. Confirm the settings by clicking **Apply**.
10. Click **Save&Run**.  
    After some time you can [check the statistics of the A/B test](/use-cases/ai-search-ab-test#analyze-results).

## Analyze results
---
When the A/B tests has been running for long enough, you can analyze the statistics for each variant.

1. Go to <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/ai-hub-icon.svg" alt="AI Hub icon" class="icon" >  **AI Hub > (AI Search) A/B/X Tests**.
2. From the list, select the test.
3. Choose the **Statistics** tab. You can find there the results for key performance indicators such as a conversion rate or revenue.  
    
   <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 find more information about [A/B test statistics here](/docs/ai-hub/ai-search/ab-test-statistics).

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

4. Compare the statistics of the two indexes you created.  
5. You can [export the settings of the winning variant](/docs/ai-hub/ai-search/configuring-ab-test#export-settings-of-the-winning-version) to your base index.



## Check the use case set up on the Synerise Demo workspace
---
In the Synerise Demo workspace, you can check the:
- [Index A](https://app.synerise.com/ai-v2/search/indices/5cd51abababc055a9c4a94984892949e1729770365/stats/global), 
- [Index B](https://app.synerise.com/ai-v2/search/indices/949f07ea19ad6450e351b9139781de701729770402/stats/global),
- [A/B test](https://app.synerise.com/ai-v2/search/abtests/1087).


If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace.  

If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. 

## Read more
---
- [AB tests](/docs/ai-hub/ai-search/configuring-ab-test)
- [AI Search](/docs/ai-hub/ai-search)