Skip to main content
This page explains the configuration of the cartridge’s content indexing job, including its configuration parameters and default attributes.

Content indexing job structure

The Content indexing job’s general structure and workflow mirror those of product indexing jobs. 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 first refreshes the SFCC content search index before extracting content assets and sends them to Algolia.

Indexed content attributes

The content job fully reindexes all content data/records with each job run. It is possible to configure at the job level which attributes to send using 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. Unlike for the product indexing jobs where there is a Custom Preference for defining defaults (that can be overridden per job), content attributes sent to Algolia are only configured at the job level by utilizing the attributeList parameter.
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 is always included in content indexing, regardless of whether these are specified in attributeList.
AttributeDescription
idContent Asset or Page ID (on Salesforce B2C)
objectIdA unique identifier on Algolia’s side for the Content Asset or Page (id + "_" + algolia_chunk_order)
algolia_chunk_orderUsed for sorting chunks that belong to the same content asset/page

Configurable attributes

You can send additional content record attributes to Algolia by listing them in the Attribute List as a job parameter. The default attributes include name, description, url, body, and page. Expand this list as needed for your use case (for example, pageTitle).
AttributeDescription
nameThe name of the content asset or page
descriptionA description of the content asset or page
urlThe URL that provides access to the page or content asset
bodyThe primary content displayed to users on the storefront
pageIndicates whether the item is a (Page Designer) page (true if so)
classificationFolderThe classification folder for the content (not applicable for Page Designer pages if the page is not assigned to a folder)
pageDescriptionA description metadata field, often used for SEO purposes
pageKeywordsA list of keywords, often used for SEO purposes but potentially also useful for site search
pageTitleA page title, used for SEO purposes and to define the browser’s page title
templateApplied for rendering content on Salesforce B2C

Customize indexed attributes

You can’t exclude algolia_chunk_order and objectId from the indexed attributes. However, you can specify which attributes should always be included by using 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. If indexOnlySearchables is false, all attributes are indexed without the need for developer support for marking an attribute as searchable, if the page is marked as searchable in the Business Manager (BM).

Content indexing job configuration

The process has two steps:
  1. SFCCContentSearchIndex: Prepares and updates the SFCC content index before browsing and sending content data to Algolia (in the second step). This predefined Salesforce B2C Commerce job step doesn’t require any additional 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 all sites for which the job should be executed.

Content indexing job parameters

ParameterDescription
attributeListA comma-separated list of attributes to be indexed.
failureThresholdPercentageThe maximum percentage of records allowed to have errors during indexing. For example, if the threshold is 10%, the indexing job fails if more than 10% of your records have an error during indexing. The temporary index will not be moved to production if the failure rate exceeds this threshold. The default is 0%.
splittingTagThe HTML tag used for splitting content asset records into chunks. Without specifying this delimiter tag, there will be no semantic splitting, but only record size-based splitting. Example: h1
includedContentDefines the indexing scope: allContents indexes both content assets and Page Designer components, contentAssets exclusively indexes content assets, and pageDesignerComponents indexes only the page designer components.
Content assets are indexed to a single body attribute. Page Designer pages are more complex—they include regions and components, each with multiple 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.

Attribute selection and performance

The job employs a retry strategy akin to those used by other API clients. The number and type of content attributes sent to Algolia impacts job performance: the more attributes you select, the longer the indexing takes. Additionally, enabling indexing of unsearchable Page Designer components might lead to longer indexing jobs. For detailed insights, refer to the performance considerations section.

Content search UI

The cartridge provides a content search UI that you can use to display content results on your storefront.
I