---
title: Push data to Coveo (SAP Commerce Cloud 2011 or later)
slug: ladf2011
canonical_url: https://docs.coveo.com/en/ladf2011/
collection: coveo-for-commerce
source_format: adoc
---
# Push data to Coveo (SAP Commerce Cloud 2011 or later)
This article explains how to push data from SAP Commerce Cloud (version 2011 or later) to a [Coveo organization](https://docs.coveo.com/en/185/).
## Install the Coveo SAP Commerce extensions
The Coveo SAP Commerce extensions allows your SAP project to exchange data with the [Coveo Platform](https://docs.coveo.com/en/186/).
To install the extensions, perform the following steps:
. Copy the `searchprovidercoveosearchservices` and `coveopushclient` extensions to the `hybris/bin/custom` directory of your project.
Depending on your SAP Commerce version, download the extensions from the appropriate branch:
[cols="1,2,3,3",options="header"]
|===
|Branch
|SAP Commerce Cloud support
|Status
|Links
|`v4`[.footnote]^[[1](#main-versions)]^
|2211-jdk21
|Active development
a|
* [coveopushclient](https://github.com/coveo/coveo-sap-commerce-connector/tree/v4/coveo/coveopushclient)
* [searchprovidercoveosearchservices](https://github.com/coveo/coveo-sap-commerce-connector/tree/v4/coveo/searchprovidercoveosearchservices)
* [CHANGELOG](https://github.com/coveo/coveo-sap-commerce-connector/blob/v4/CHANGELOG.md)
|`v3`[.footnote]^[[1](#main-versions)]^
|2211
|Active development
a|
* [coveopushclient](https://github.com/coveo/coveo-sap-commerce-connector/tree/v3/coveo/coveopushclient)
* [searchprovidercoveosearchservices](https://github.com/coveo/coveo-sap-commerce-connector/tree/v3/coveo/searchprovidercoveosearchservices)
* [CHANGELOG](https://github.com/coveo/coveo-sap-commerce-connector/blob/v3/CHANGELOG.md)
|`v2`[.footnote]^[[1](#main-versions)]^
|2105, 2205
a|Maintained, with no new features.
This is because the SAP Commerce Cloud versions [2105](https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD?version=v2105&locale=en-US) and [2205](https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD?version=v2205&locale=en-US) are out of maintenance.
a|
* [coveopushclient](https://github.com/coveo/coveo-sap-commerce-connector/tree/v2/coveo/coveopushclient)
* [searchprovidercoveosearchservices](https://github.com/coveo/coveo-sap-commerce-connector/tree/v2/coveo/searchprovidercoveosearchservices)
* [CHANGELOG](https://github.com/coveo/coveo-sap-commerce-connector/blob/v2/CHANGELOG.md)
|`v1`
|2011
a|Deprecated.
This is because the SAP Commerce Cloud version [2011](https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD?version=v2011) is out of maintenance.
a|
* [searchprovidercoveosearchservices](https://github.com/coveo/coveo-sap-commerce-connector/tree/v1/coveo/searchprovidercoveosearchservices)
|===
--
1. In the `v4`, `v3` and `v2` branches, you can find that the extensions have different minor and patch versions.
For detailed changes between versions, see the [v4 Change log](https://github.com/coveo/coveo-sap-commerce-connector/blob/v4/CHANGELOG.md), the [v3 Change log](https://github.com/coveo/coveo-sap-commerce-connector/blob/v3/CHANGELOG.md), or the [v2 Change log](https://github.com/coveo/coveo-sap-commerce-connector/blob/v2/CHANGELOG.md).
--
. Open the `hybris/config/localextensions.xml` file and add the extensions:
```xml
```
> **Retries**
>
> The `coveopushclient` extension enables more retries for the indexing process.
> See details in the [Retry indexing](#retry-indexing) section.
. Set up the Ant environment by running the script:
```shell
. ./setantenv.sh
```
. From the root of your project directory, run the following command:
```shell
ant clean all
```
. After the command execution, navigate to the `hybris/bin/platform` directory.
. Start your SAP Commerce installation by running the script:
```shell
./hybrisserver.sh
```
By default, your local server would use ports 9001 (http) and 9002 (https).
. Open the SAP Commerce Administration Console (or HAC, Hybris Administration console) at https://localhost:9002/platform/update.
You can also navigate to the Update page by clicking **Platform → Update** in the top menu.
. Find and select the checkboxes for:
** `searchprovidercoveosearchservices` (required to create the new search provider)
** `Update running system`
** `Localize types`
. At the top of the page, click **Update**.
> **Note**
>
> The extension creates new data types in the database, but it doesn't import any data.
> **Semi-automatic configuration**
>
> In the `searchprovidercoveosearchservices` extension code base, if you navigate to `resources/examples`, you'll find the `electronics-search-configuration-example.impex` file.
> This is an example impex of how you can perform the SAP Commerce Cloud configuration in a programmatic way.
> This can be used as a template to fill with your data and configure your project faster.
>
> You can also manually configure every source and your indexes via the Backoffice. Perform the following steps to do so.
### Customize the extension
It's not recommended to modify the extension code directly as it complicates upgrades to newer versions.
If you need custom functionality, you can follow this approach:
. Create your own [custom SAP Commerce extension](https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/e1391e5265574bfbb56ca4c0573ba1dc/131c2b90df11469bb14bad64c06bbeeb.html).
. Update the `/hybris/bin/custom//extensioninfo.xml` so that your extension depends on the `searchprovidercoveosearchservices` extension.
```xml
```
. In your extension, either implement interfaces from the `searchprovidercoveosearchservices` extension or extend the existing classes with your custom logic.
. In the `/hybris/bin/custom//resources/-spring.xml` file, add and configure your [beans](https://help.sap.com/docs/SAP_COMMERCE/d0224eca81e249cb821f2cdf45a82ace/8c63621986691014a7e0a18695d7d410.html).
This way, the Coveo extension's upgrades and your custom code won't interfere with each other.
> **Custom value providers**
>
> If you need to manipulate your data in a specific way, it's recommended to build your own value providers within your custom extension.
> The Coveo extension contains several example value providers that can be used as templates to help you get started.
>
> See [Step 10: Use the value providers](#step-10-use-the-value-providers).
## Coveo setup
### Step 1: Create a source in your Coveo organization
For storing the SAP catalog data, you need a [Catalog source](https://docs.coveo.com/en/l5if0244/).
. Log in to the [Coveo Administration Console](https://docs.coveo.com/en/183/).
. [Add the Catalog sources](https://docs.coveo.com/en/n8of0593/) that you'll be pushing your data to.
The guidelines for creating sources are:
** Each combination of language, currency, and country existing in your data should have a separate Coveo Catalog source to push to.
** Any availability data you have should also have it's own dedicated Catalog source.
. Take note of the [Stream API URL](https://docs.coveo.com/en/n8of0593#stream-api-url) value for your source.
### Step 2: Create an API key
Create one API key that you'll use for all your sources.
See [Manage API keys](https://docs.coveo.com/en/1718/).
The key should have the edit privileges detailed here: [Catalog source privileges](https://docs.coveo.com/en/n8of0593#required-privileges).
See the **Edit sources, edit source update schedules, and view the View and map metadata page** row in the privileges table.
## SAP Commerce setup
### Step 1: Create Coveo sources
For each source you created in the Coveo Administration Console you should perform the following steps in the SAP Backoffice.
. In the [SAP Backoffice Administration Cockpit](https://help.sap.com/docs/SAP_COMMERCE/5c9ea0c629214e42b727bf08800d8dfa/8c16979286691014abe6f41434c7614a.html), go to **System** → **API** → **Destinations** → **Coveo Source**.
. Click the plus sign (+) above the search results.
. In the modal window that appears, enter a unique ID that represents your Catalog source.
It's recommended to use a human-readable value to assist with identifying a specific source.
. Click **Finish**.
. Select the newly created item from the search listing.
. On the **General** tab:
.. Fill in the **Name** field.
.. In the **Object type** menu, specify the type that matches your Coveo source:
[cols="2,5"]
|===
|**AVAILABILITY**
|This type is for the availability source.
See [Source configuration approaches for availability channel](https://docs.coveo.com/en/nbga0384/) and [Catalog availability data](https://docs.coveo.com/en/m53g0124/).
|**PRODUCTANDVARIANT**
a|This type is for the products and variations.
See [Catalog product data](https://docs.coveo.com/en/m53g7119/) and [Catalog variant data and product groupings](https://docs.coveo.com/en/m53g0506/).
When selecting an object type of `PRODUCTANDVARIANT`, `Language`, `Currency`, and `Country` are mandatory for the system to determine the correct source for your product data.
* `Language` is a four-letter code that combines [ISO 639](https://www.iso.org/iso-639-language-code) and [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) standards, such as `en_US`.
* `Currency` is a three-letter [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) code, such as `USD`.
* `Country` is a two-letter [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) code, such as `US`.
|===
. Click **Save**.
### Step 2: Create a consumed destination
. Go to **System** → **API** → **Destinations** → **Consumed Destinations**.
. Click the plus sign (+) above the search results.
. In the modal window that appears:
[cols="2,5"]
|===
|**ID**
|Enter a unique ID that represents your Catalog source.
|**URL**
a|Paste the Stream API URL that you copied from the Coveo Catalog source.
Details
. In your Coveo organization, open the Catalog source you created in [step 1](#step-1-create-a-source-in-your-coveo-organization).
. On the **Configuration** tab, there's a section called **Stream API URL**.
Click **Copy to clipboard** to copy the URL.
|**Active**
|Verify that the **Active** checkbox is selected.
|**Destination Target**
a|Click the field and select **Default_Template**.
> **Note**
>
> The destination target you select doesn't matter as it's not used in the push implementation and only needed to create the destination.
|===
. Click **Finish**.

Now you see the destination you created in the list of consumed destinations.
### Step 3: Create a credential for the consumed destination
> **Important**
>
> If you have a number of sources, you only need to create one OAuth Credential and attach it to many Consumed Destinations.
. Click the destination you created and switch to the **Destination Configuration** tab.
. Double-click in the **Credential** field to open a dropdown menu and select **Create Credential** → **Consumed OAuth Credential**.
. Fill in the following fields:
[cols="2,5"]
|===
|**ID**
|Enter a unique ID for a new credential.
For example, `CoveoCredential`.
|**Client ID**
|Enter a client ID for a new credential. For example, `CoveoClientID`.
|===
. Click **Finish**. You see the **Destination Configuration** tab again.
. Double-click in the **Credential** field to open the credential settings.
. In the **Client Secret** section, there are **Password** and **Verify password** fields.
In both fields, paste the Coveo API key that you created earlier.
. Click **Save** to save and close the credential settings.
. Click **Save** to save the destination settings.

### Step 4: Assign the consumed destination to the Coveo source
. Return to **System** → **API** → **Destinations** → **Coveo Source**.
. Click your Coveo source.
. On the **General** tab, find the **Consumed Destination** field.
. Specify the consumed destination that you created earlier.
. Click **Save**.
### Step 5: Create a search provider
Now that you've mapped the Coveo sources to the SAP Commerce API destinations, you must configure the search index to push the data to Coveo.
. Go to the **System** → **Search and Navigation** → **Search Provider Configurations** page.
. Next to the plus sign, click the dropdown menu and select **Coveo Search Provider Configuration**.
. Fill in the following fields:
[cols="2,5"]
|===
|**Identifier**
|Enter a unique identifier for a new search provider, for example, `CoveoSearchProviderID`.
|**Name**
| Enter a name for a new search provider, for example, `Coveo Search Provider Configuration`.
|**Coveo Source**
|Select all the [Coveo sources that you created](#step-1-create-coveo-sources).
|===
. Click **Finish**. Now you see the provider you created in the list of search providers.
### Step 6: Create the index configuration
. Go to **System** → **Search and Navigation** → **Index Configurations**.
. Next to the plus sign (+), click the dropdown menu and select **CoveoSnIndexConfiguration**.
. Fill in the following fields:
[cols="2,5"]
|===
|**Identifier**
|Enter a unique identifier for a new configuration, for example, `CoveoIndexID`.
|**Name**
|Enter a name for a new search provider, for example, `Coveo Index Configuration`.
|**Search Provider Configuration**
|Select the Coveo Search Provider Configuration [created in the previous step](#step-6-create-the-index-configuration).
|===
. Click **Next** to proceed to the next step, **Index Types**.
Skip this step for now and click **Next** again.
. In the **Session** step, select all the **Languages**, **Currencies**, and **Countries** that are relevant for your data.
> **Important**
>
> You must fill in the **User** field if you have data with access restrictions.
> If that's the case, specify the user name with the necessary permissions to access the data.
>
> Otherwise, you can leave the **User** field empty or set the user as `Anonymous` as it's done in the [example impex file in the extension code base](https://github.com/coveo/coveo-sap-commerce-connector/blob/v4/coveo/searchprovidercoveosearchservices/resources/examples/electronics-search-configuration-example.impex#L40).
>
> 
. Click **Finish**.
### Step 7: Create the ServiceLayerJobs
> **Tip**
>
> Skip this step if you're using the connector version 3.1.3 or later.
> The connector versions starting from 3.1.3 have the ServiceLayerJobs created automatically.
Create the ServiceLayerJobs for the future cron jobs, one for incremental indexing and one for full indexing.
> **Note**
>
> Based on your SAP Commerce Cloud updates, the incremental indexing job:
>
> * Adds new products to your Coveo sources.
>
> * Removes, modifies, or adds [fields](https://docs.coveo.com/en/200/) to existing products in your Coveo sources.
>
> The full indexing job does all that the incremental indexing job does, and also deletes items from your Coveo sources that have been removed from SAP Commerce Cloud.
. Go to **System** → **Types**.
. In the search bar, type in `ServicelayerJob` and search.
. In the search results, click the **ServicelayerJob**.
The properties of the ServicelayerJob are displayed on the page.
. In the upper part of the properties, click the search icon that's titled **Search by type**.
. Click the plus sign (+) above the search listing.
. In the modal window that appears:
[cols="2,5"]
|===
|**Spring ID**
|Paste `fullCoveoSnIndexerJob`.
|**Code**
|Paste `fullCoveoSnIndexerJob`.
|===
. Click **Finish**.
. Perform the same steps to create another ServicelayerJob for which specify `incrementalCoveoSnIndexerJob` for the **Code** and the **Spring ID** attributes.
> **Note**
>
> The Coveo SAP Commerce extension doesn't currently support [Coveo partial catalog updates](https://docs.coveo.com/en/p4eb0515/).
> Although SAP Commerce Cloud provides a `PARTIAL_UPDATE` indexing operation that updates only specific fields, this operation doesn't fully align with how Coveo expects partial updates to work.
>
> SAP's `PARTIAL_UPDATE` operation triggers an update for the selected fields whenever any change occurs on a product, whereas Coveo partial updates are designed to only update a field when the value of that specific field changes.
> Using SAP's approach could lead to over-consuming your Coveo partial update limits.
>
> One reason you might consider partial updates is to merge data from multiple SAP Commerce instances into Coveo (for example, product details from one instance and inventory from another).
> Since partial updates aren't supported by this extension, you should instead aggregate all the data you need into a single SAP Commerce instance before indexing.
> The Coveo SAP Commerce extension is designed to run from a single instance where all searchable data is available.
### Step 8: Create the Index types
Create one Index type for full indexing and one for incremental indexing.
. Go to **System** → **Search and Navigation** → **Index Types**.
. Click the plus sign (+) above the search results.
. In the modal window that appears, in the **Essential** step, fill in the following fields:
[cols="2,5"]
|===
|**Identifier**
|Enter a unique identifier for a new type, for example, `CoveoFullIndexTypeID`.
|**Name**
|Enter a name for a new type, for example, `Coveo Full Index Type Configuration`.
|**Composed Type**
a|Specify the type that matches a Coveo Object type for the source you'll use this to push data to.
**Example**
If this index type will be used to push `availability` objects, then you may want to select the `Warehouse` Composed type.
This will be dependent on how your data is structured.
|**Index Configuration**
|Select the Coveo Index Configuration created in the previous steps.
|===
. The next steps can be configured later, so you may skip them for now. Click **Next** to proceed to the **Cron Jobs** step.
. In the **Cron Jobs** step, click the plus sign (+) at the end of the dropdown menu.
. Select **Full Indexer Cronjob**.
. Fill in the following fields:
** **Code**. Enter a unique code for the cron job, for example, `coveoFullIndexType`.
** **Job Definition**. Select the `fullCoveoSnIndexerJob` system type. The chosen type should correspond to the type of cron job you're creating.
** **Indexer Item Source**. Click this field to create a **Flexible Search Indexer Item Source**.
In the modal window that appears, fill in the **Query** field. It must be the [FlexibleSearch](https://help.sap.com/docs/SAP_COMMERCE/d0224eca81e249cb821f2cdf45a82ace/8bc399c186691014b8fce25e96614547.html) query that will be used to retrieve the Composed Type. For example, if you selected Warehouse for your `availability` object, the following query would retrieve all warehouses for the electronics site:
```sql
SELECT {w:PK}
FROM {Warehouse as w
JOIN BaseStore2WarehouseRel as rel ON {w:PK} = {rel:target}
JOIN BaseStore AS bs ON {rel:source} = {bs:PK}
}
WHERE {bs:uid}='electronics'
```
For product indexing, the following query would retrieve all approved products in the catalog.
```sql
SELECT {p:pk}
FROM {Product AS p
LEFT JOIN ArticleApprovalStatus AS a ON {p:approvalStatus} = {a:pk}
}
WHERE {a:code} = 'approved'
```
. Click **Finish** for every modal window that has been opened.
. Select the newly created Index type.
. On the **General** tab, configure the **Identity Provider** as `snIdentityProvider` and link the catalog you want to index in the **Catalogs** field.
. Perform the same steps to create an Index type for incremental indexing, but adjust them as follows:
** in the **Essential** step, update the **Identifier** and **Name** fields to reflect the incremental indexing type.
** in the **Create Cron Jobs** step, select **Incremental Indexer Cronjob**.
Use `coveoIncrementalIndexType` for the **Code** attribute and `incrementalCoveoSnIndexerJob` for the **Job Definition** attribute.
Update the FlexibleSearch query to match the incremental indexing requirements.
### Step 9: Create the objectType field
In both created Index types, create a field that will be used to specify the Coveo object type.
. Click the required Index type, either `coveoFullIndexType` or `coveoIncrementalIndexType`.
. Switch to the **Fields** tab.
. For Coveo Push solution, the **Code**, **Name**, and **DocumentId** fields are mandatory.
. Click in the Fields menu, to create a field specific for Coveo.
> **Note**
>
> You can create as many additional fields as you need to push to the [Coveo Platform](https://docs.coveo.com/en/186/).
> In this example, you'll create one field, `objectType`.
. In the modal window that appears, fill in the following fields:
[cols="2,5"]
|===
|**Identifier**
|Enter `objectType`.
|**Name**
|Enter `Object Type`.
|**Field Type**
|Select `TEXT`.
|===
. Click **Next**.
. In the **Indexer** step, paste `coveoObjectTypeSnIndexerValueProvider` in the **Value Provider** field.
. Click **Finish**.
. In your SAP Commerce Cloud project, open the `hybris/bin/custom/searchprovidercoveosearchservices/project.properties` file.
. There will be three properties, each maps one Coveo Source object with one or more Composed Index types.
For example, if you created a `Warehouse` Composed index type for the `availability` object, add it to the `coveo.availability.typecodes` property.
```bash
coveo.availability.typecodes=Warehouse
coveo.product.typecodes=Product
coveo.variant.typecodes=VariantProduct
```
### Step 10: Use the value providers
Your Coveo organization has a set of expected fields to be indexed, see [Standard commerce fields](https://docs.coveo.com/en/n73f0502#standard-commerce-fields). The values for these fields should follow the Coveo index format.
However, your SAP Commerce Cloud project might generate values whose formats are different from what the Coveo index expects, so this will lead to errors during indexing.
To handle this, you can employ value providers to retrieve and change field names from the SAP Commerce Cloud database.
The `searchprovidercoveosearchservices` extension includes two sets of value providers:
* Standard value providers that retrieve values directly from the database.
For the list of provider names, see the [example impex file in the extension code base](https://github.com/coveo/coveo-sap-commerce-connector/blob/v4/coveo/searchprovidercoveosearchservices/resources/examples/electronics-search-configuration-example.impex#L46).
* Coveo Platform value providers that transform the values before they're pushed to the Coveo Platform.
Examine the table below to learn more about the Coveo Platform-specific value providers.
**Coveo Platform-specific value providers**
[%header,cols="1,1,4"]
|===
|Provider name
|Provider ID
|Description
a|`coveoObjectType{zwsp}SnIndexerValueProvider`
> **Important**
>
> It's a mandatory provider for the Coveo indexer to work.
|`objectType`
a|This value provider uses the following properties:
* `coveo.availability.typecodes`
* `coveo.product.typecodes`
* `coveo.variant.typecodes`
Each property can be set in the `local.properties` file and is a comma-separated list of the composed item types in SAP Commerce Cloud that map to one of the 3 object types in the [catalog entity](https://docs.coveo.com/en/3143/).
a|`coveoDocument{zwsp}IdSnIndexerValueProvider`
> **Important**
>
> It's a mandatory provider for the Coveo indexer to work.
|`coveoDocumentId`
a|This value provider builds a document ID that follows the URI format required by the [Coveo Platform](https://docs.coveo.com/en/186/), `{prefix}://{uniqueId}`.
The provider requires the `valueProviderParameters` to include a prefix value.
For example, if the provider has the `valueProviderParameters` set as `prefix → product\|expression → code`, it will use the expression to use the code attribute of the product and generate the unique value in the form of `product://12345`.
a|`coveoSimpleClickable{zwsp}ProductUriSnIndexer{zwsp}ValueProvider`
|`coveoClickableUri`
a|This value provider extends the default `ProductUrlSnIndexerValueProvider` to provide a full, clickable URL for the index.
The default provider only gets the path of the product, and not the domain.
The SAP Commerce Cloud convention is to have a property in the form of `website.{storeId}.https` which holds the value of the storefronts domain.
By adding this value to that returned by the `ProductUrlSnIndexerValueProvider`, it's possible to generate the full clickable URL for the index.
To do that, set the `valueProviderParameters` to `siteId → {yourSiteID}` with the correct property set up in your local properties.
Not required, but recommended.
a|`coveoWarehouse{zwsp}AvailableSkus{zwsp}SnIndexerProvider`
|`coveoAvailableSkus`
a|This value provider is an example of how to send an array of attributes to your Coveo index.
The provider gets all the products within a warehouse (even if there are none left in stock) and returns them as an array.
For the `fieldType` attribute of this provider, use the value `COVEOARRAY`.
a|`CoveoSkuStockLevel{zwsp}WarehouseAvailabilitySn{zwsp}IndexerValueProvider`
| N/A
(not in the example impex file)
a| This value provider is similar to `coveoWarehouse{zwsp}AvailableSkus{zwsp}SnIndexerProvider`, but only returns items that are in stock at the target warehouse.
By default, a product is considered in stock if more than `0` are available.
You can change this threshold by setting the `coveo.availability.lowstock.threshold` property in your [local.properties](https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/d97b2ab46fde43a78640036ebf68e106/30a97a12eca14afbaaac88b592f5e25c.html) file.
a|`coveoProductPriceToUser{zwsp}PriceGroupSnIndexer{zwsp}ValueProvider`
|`priceToPriceGroup`
a|This value provider is an example of how to generate a dictionary object of localized values to the index.
The example has a user pricing group to price dictionary, where the currency will determine what data to send to each source.
For the `qualifierTypeId` attribute of this provider, the value `currency` is used.
This informs the indexer about the mapping where the key of the map is the currency.
The value of the map is the dictionary to push to the index. In this example, it's a map of user price group to price value.
a|`coveoProduct{zwsp}StockLevel{zwsp}SnIndexerValueProvider`
|`stockLevels`
a|This value provider is an example of how to generate a standard dictionary object.
The example gets the stock levels of a product for the warehouses it can be available in.
For the `qualifierTypeId` attribute of this provider, the value `warehouse` is used. This informs the indexer that the keys for the map will be the **Warehouse** composed type. This requires to use the `CoveoWarehouseSnQualifierProvider` to determine all the possible warehouses that can be a key for the map returned by the value provider.
a|`coveoProduct{zwsp}CategoryHierarchy{zwsp}AttributeSnIndex{zwsp}ValueProvider`
|`coveoProduct{zwsp}CategoryHierarchy`
a|This value provider returns a value with the category hierarchy in the specific format required by the Coveo index.
It leverages the OOTB `ProductCategoryAttribute{zwsp}SnIndexerValueProvider` to get the correct category data, and then reconstructs the category paths in the format required. To do that, it uses the `valueProviderParameters` in the form of `rootCategory → {rootCategoryId}\|expression → \{attribute\}`.
By default, the root category name is excluded from the paths you push as this will be common to all products in the index.
|===
#### Dictionary value providers
The Coveo index supports [dictionary fields](https://docs.coveo.com/en/2036/), which are key-value pairs used to store additional information about an indexed item within a single [field](https://docs.coveo.com/en/200/).
However, you must ensure that the following requirements are met for the dictionary value providers to work correctly:
* In your impex file, the `multiValued` parameter must be explicitly set to `false` for each dictionary or it must be the default in the value provider's parameters.
```
// ...
INSERT_UPDATE SnField; indexType(id)[unique = true]; id[unique = true]; name ; fieldType(code); localized[default = false]; valueProvider ; valueProviderParameters[map-delimiter = |]; qualifierTypeId; searchable[default = false]; retrievable[default = false]; multiValued[default = false]; useForSuggesting[default = false]; useForSpellchecking[default = false]
; $coveoProductIndexType ; price ; Price ; TEXT ; ; valueProviderName ; ; ; ; true ; ; ;
// ...
```
With `multiValued` set to `false`, the value provider returns a single dictionary object that can be indexed correctly.
This is a `Map` or `Map` object that contains the key-value pairs.
**[check] Correct**
```js
{value1: 300, value2: 500, value3: 1000}
```
However, if `multiValued` is set to `true`, SAP Commerce Cloud will treat the dictionary as an array with one value.
**[x] Incorrect**
```js
[{value1: 300, value2: 500, value3: 1000}]
```
* If you're using a custom value provider for dictionaries, it must return a `Map` or `Map` object.
### Step 11: Map the catalog fields
For both created Index types, map catalog fields with the Coveo fields.
Do the mapping only for the fields that you want to push to Coveo.
. Navigate to the **System** → **Search and Navigation** → **Index Types** page.
. In the list of index types, click the required index type.
. Switch to the **Fields** tab.
. Examine the fields.
> **Important**
>
> Make sure there are only fields that you want to push to Coveo.
> The rest should be removed as they will add to the indexing time.
>
> Although leaving them in won't cause the indexing to fail, it's recommended to remove them for optimization.
. Examine the **Identifier** column.
The values in it should match the field name that was set within the source in the [Coveo Administration Console](https://docs.coveo.com/en/183/).
See [Manage source mappings](https://docs.coveo.com/en/1640/) and [Mapping rule syntax reference](https://docs.coveo.com/en/1839/).
**Example**
For the SAP field `name`, you must create the mapping `%[name]` in the [Coveo Administration Console](https://docs.coveo.com/en/183/).

←→

. To create a new field, do so the same way you created the `objectType` field in the previous step.
### Step 12: Run the indexers
Once you've configured your system correctly, you can run your indexers.
. Navigate to the **System** → **Search and Navigation** → **Index Types** page.
. In the list of index types, click the required index type.
. Switch to the **Cron Jobs** tab.
. Click the required cronjob.
.. Make sure that the cronjob is enabled, see the **True** checkbox in the **Enabled** section.
.. On the **Time Schedule** tab, you can set the time when the cronjob should run.
> **Important**
>
> For the full indexer, it's recommended to run it relatively often to ensure the consistency of the data between your SAP Commerce Cloud project and the Coveo index.
> For example, you can schedule the full indexer to run every two or three days, but the exact timeframe will depend on your judgment based on the number of products in your catalog.
>
> The exact time depends on the amount of data you have and how often it changes.
. Click **Save** to save and close the cronjob settings.
. While having the index type open, switch to the **Administration** tab.
. Check that the **Stores** field is set to the store you want to index.

. Above the index tabs, click **Run indexer**.
. In the modal window that appears, click the dropdown menu and select the cronjob that you've just enabled.
. Click **Run**.
You can track the indexing progress by clicking **Processes** at the top of the Administration Cockpit.
#### Retry indexing
If the full indexing fails, the default behavior of SAP Commerce Cloud is to retry the indexing up to 3 times.
However, this hardcoded amount of retries might not be enough in your case.
Both the [Coveo extension](#coveo-extension-retries) and [SAP Commerce Cloud](#sap-commerce-cloud-retries) let you retry programmatically until indexing is complete.
##### Coveo extension retries
The `coveopushclient` extension lets you configure retries.
These retries are especially efficient if you're hitting Coveo Stream API rate limits.
To enable the retries, make sure you:
. Downloaded the version `3.4.1` or later from the `[v4](https://github.com/coveo/coveo-sap-commerce-connector/tree/v4/coveo/coveopushclient)` branch or the version `2.1.7` from the `[v2](https://github.com/coveo/coveo-sap-commerce-connector/tree/v2/coveo/coveopushclient)` branch.
. Added the `coveopushclient` extension in the `hybris/config/localextensions.xml` file, [as shown in an installation step earlier](#install-the-coveo-sap-commerce-extensions).
By default, the `coveopushclient` extension will retry the indexing process 10 times, with a 5-second delay before the first retry.
To change these values, you can do so in the `hybris/bin/custom/coveopushclient/project.properties` file:
```bash
coveopushclient.retryafter.milliseconds=5000
coveopushclient.maxretries=10
```
After the first retry, each subsequent retry will occur at exponentially increasing intervals with a multiplier of 2.
Note that you can change the initial delay but not the multiplier.
**Example**
* retry 1 happens in 5 s
* retry 2 happens in 5 x 2 = 10 s
* retry 3 happens in 10 x 2 = 20 s
* retry 4 happens in 20 x 2 = 40 s
##### SAP Commerce Cloud retries
Since release [2211.32](https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/75d4c3895cb346008545900bffe851ce/68f043d2fe00428dad5f1ba28195ac67.html?q=SnRetryConfiguration), SAP Commerce Cloud exposes the `SnRetryConfiguration` type that lets you configure the number of retries and the delay between them.
These retries happen on the SAP Commerce Cloud and are especially efficient if you're facing SAP Hybris issues, such as multithreading, databases, and data retrieval problems.
Configure these retries programmatically in the target `impex` file.
Create a `SnRetryConfiguration` retry configuration and use it in your `SnIndexerConfiguration`, where you configure your Coveo indexer.
The following example sets a retry configuration with:
* at most `5` attempts
* a `30`-second timeout
* an initial delay of `500` ms before the first retry
* an interval of `1` second before the second retry
* a maximum interval of `10` min
* a multiplier of `2` between retries
```
// ...
INSERT_UPDATE SnRetryConfiguration; id[unique = true] ; maxAttempts; timeout; initialDelay; interval; maxInterval; multiplier
; coveo-retry-configuration ; 5 ; 30000 ; 500 ; 1000 ; 600000 ; 2
INSERT_UPDATE SnIndexerConfiguration; &indexerConfig ; id[unique = true] ; name ; concurrency; batchSize ; retryConfiguration(id)
; coveoIndexerConfiguration ; coveoIndexerConfiguration ; Coveo Electronics Indexer Configuration ; 5 ; 10 ; coveo-retry-configuration
// ...
```