> ## Documentation Index
> Fetch the complete documentation index at: https://www.algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Index your Salesforce B2C Commerce content with Algolia.

This page explains how to configure the cartridge's content indexing job,
including its parameters and default attributes.

## Content indexing job structure

The Content indexing job's general structure and workflow mirror those of [product indexing jobs](https://www.algolia.com/doc/integration/salesforce-commerce-cloud-b2c/indexing/product-indexing/overview).
The cartridge's content indexing uses the Salesforce B2C Content Search Model (`ContentSearchModel`) to browse content assets.
This is why the job has two steps: `SFCCContentSearchIndex` and `algoliaContentIndex`.
The job refreshes the SFCC content search index (An Algolia index is a searchable dataset that consists of records and configuration settings. These settings define how the records are searched and ranked.) before extracting content assets and sending them to Algolia.

## Indexed content attributes

The content job [fully reindexes](https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/in-depth/the-different-synchronization-strategies.md#full-reindexing) all content data and records (A record is a searchable object in an Algolia index. Each record consists of named attributes.) with each job run.
You can configure which attributes to send at the job level with the `attributeList` parameter.

By default, the content indexing job sends the following attributes to Algolia: `id`, `name`, `description`, `url`, `body`, `page`, and `algolia_chunk_order`.
Product indexing jobs use a [Custom Preference](https://www.algolia.com/doc/integration/salesforce-commerce-cloud-b2c/getting-started/custom-preferences.md?client=javascript) to set default attributes, and you can override this per job.
Content indexing jobs work differently: you set attributes only at the job level, using the `attributeList` parameter.

> [!NOTE]
>
> The job intentionally ignores and removes some HTML tags, such as the `script` tag,
> since content from these tags isn't meaningful for search.

### Base attributes

The base set of attributes always appears in content indexing, even if you don't list them in `attributeList`.

| Attribute | Description |
| - | - |
| **id** | Content Asset or Page ID (on Salesforce B2C) |
| **objectId** | A unique identifier on Algolia's side for the Content Asset or Page (`id + "_" + algolia_chunk_order`) |
| **algolia\_chunk\_order** | Used for sorting chunks that belong to the same content asset/page |

### Configurable attributes

You can send other content record attributes to Algolia.
List them in the **Attribute List** job parameter.

The default attributes include `name`, `description`, `url`, `body`, and `page`.
Expand this list as needed for your use case (for example, `pageTitle`).

| Attribute | Description |
| - | - |
| **name** | The name of the content asset or page |
| **description** | A description of the content asset or page |
| **url** | The URL that provides access to the page or content asset |
| **body** | The primary content displayed to users on the storefront |
| **page** | Indicates whether the item is a (Page Designer) page (`true` if so) |
| **classificationFolder** | The classification folder for the content (not applicable for Page Designer pages if the page isn't assigned to a folder) |
| **pageDescription** | A description metadata field, often used for SEO purposes |
| **pageKeywords** | A list of keywords, often used for SEO purposes but potentially also useful for site search |
| **pageTitle** | A page title, used for SEO purposes and to define the browser's page title |
| **template** | Applied for rendering content on Salesforce B2C |

### Customize indexed attributes

You can't exclude `algolia_chunk_order` and `objectId` from the indexed attributes.
To set attributes that should always appear, use `defaultAttributes` in `cartridges/int_algolia/cartridge/scripts/algolia/lib/algoliaContentConfig.js`.

### Index unsearchable page designer content

By default, the cartridge conforms to Salesforce B2C's standard indexing policy, which indexes only the searchable attributes of Page Designer components.
This can be overridden on a code level with the `indexOnlySearchables` boolean flag in [pageDesignerHelper.js](https://github.com/algolia/algoliasearch-sfcc-b2c/blob/master/cartridges/int_algolia/cartridge/scripts/algolia/lib/pageDesignerHelper.js).
If `indexOnlySearchables` is false, the job indexes all attributes as long as the page is marked as searchable in the Business Manager (BM).
You don't need to mark each attribute as searchable.

## Content indexing job configuration

The process has two steps:

1. **SFCCContentSearchIndex**. Prepares and updates the [SFCC content index](https://help.salesforce.com/s/articleView?id=cc.b2c_index_creation.htm\&type=5).
   The next step browses and sends content data to Algolia.
   This predefined Salesforce B2C Commerce job step doesn't need extra configuration.
2. **algoliaContentIndex**: Extracts data from content assets and Page Designer pages and indexes it with Algolia.

The job configuration is accessible in the Job Steps tab.
Set the scope to Specific Sites and select each site that runs this job.

### Content indexing job parameters

| Parameter | Description |
| - | - |
| **attributeList** | A comma-separated list of [attributes](#configurable-attributes) to index. |
| **failureThresholdPercentage** | The percentage of records that can have errors during indexing. For example, if you set the threshold to 10%, the job fails when more than 10% of your records have an error. If the failure rate exceeds this threshold, the job doesn't move the temporary index to production. The default is 0%. |
| **splittingTag** | The [HTML tag used for splitting content asset records](https://www.algolia.com/doc/integration/salesforce-commerce-cloud-b2c/indexing/content-indexing/fundamentals#split) into chunks. If you don't specify this delimiter tag, the job skips semantic splitting and uses only [record size-based splitting](https://www.algolia.com/doc/integration/salesforce-commerce-cloud-b2c/indexing/content-indexing/fundamentals#record-size-splitting) instead. Example: `h1` |
| **includedContent** | Defines the indexing scope. `allContents` indexes both content assets and Page Designer components. `contentAssets` indexes only content assets. `pageDesignerComponents` indexes only Page Designer components. |

The job indexes content assets to a single `body` attribute.
Page Designer pages are more complex: they include regions and components, each with several attributes.

To handle this flexible structure, the cartridge uses `pageDesignerHelper.js`,
which recursively extracts and organizes the page's tree-like data.

For details, see Salesforce's [Page Designer documentation](https://developer.salesforce.com/docs/commerce).

### Attribute selection and performance

The job uses the same retry strategy as other API clients.

The number and category of content attributes you send to Algolia affects job performance: the more attributes you select, the longer indexing takes.
Enabling [indexing of unsearchable Page Designer components](#index-unsearchable-page-designer-content) can also make indexing jobs longer.
For detailed insights, refer to the [performance considerations section](https://www.algolia.com/doc/integration/salesforce-commerce-cloud-b2c/guides/performance-considerations.md#content-indexing).

### Content search UI

The cartridge provides a [content search UI](https://www.algolia.com/doc/integration/salesforce-commerce-cloud-b2c/building-the-search-ui/front-end.md#content-search-ui) that you can use to display content results on your storefront.
