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 refreshes the SFCC content search before extracting content assets and sending them to Algolia.
Indexed content attributes
The content job fully reindexes all content data and with each job run. You can configure which attributes to send at the job level with theattributeList 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 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.
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 inattributeList.
Configurable attributes
You can send other content record attributes to Algolia. List them in the Attribute List job parameter. The default attributes includename, description, url, body, and page.
Expand this list as needed for your use case (for example, pageTitle).
Customize indexed attributes
You can’t excludealgolia_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 theindexOnlySearchables boolean flag in 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:- SFCCContentSearchIndex. Prepares and updates the SFCC content index. The next step browses and sends content data to Algolia. This predefined Salesforce B2C Commerce job step doesn’t need extra configuration.
- algoliaContentIndex: Extracts data from content assets and Page Designer pages and indexes it with Algolia.
Content indexing job parameters
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.