Add a JSON template to a content item
Feature availability is part of a phased rollout. Your organization may not see the search experience functionality yet. It will become available when your environment is included in the rollout.
When you add the search component to a page in SitecoreAI, you must assign a content item. A content item is a structured piece of information in your Sitecore content tree. Each item represents an entity on your website, such as a page, component, configuration object, data source, or feature definition
Like any other entity on your website, a search experience is a type of content item. It appears in the content tree as its own item, with fields that control how that experience behaves and is rendered.
You configure the search experience by adding JSON to the content item. In this context, the JSON you add to the content item acts as a template because it defines the structure and required properties the search component expects. Adding the JSON ensures the component receives valid configuration values, such as which search index to use and how to map UI fields, and prevents rendering issues that occur when required fields are missing.
The JSON template must include these core properties for the search component to run:
-
searchIndex - the GUID of the search source/index to query.
-
fieldsMapping - Maps component UI fields to the content fields in your template.
Ensure that search experiences are configured for your environment by following Get started with search experiences.
Configure the content item with a JSON template
To configure the content item with a JSON template:
-
In the Content editor, on the left-hand content tree, navigate to /sitecore/content/sync/<YOUR_SITE>/Data/Search Experiences/global-search.
-
Insert a search experience content item, or click on the existing search experience content item.
-
In the Data section, in the search field, enter the required JSON properties. See the code sample below for more detail.
-
Click Save.
-
In the top menu bar, click Publish.
-
In the Publish drop-down list, click either Publish site or Publish item.
Example of a content item template
The JSON template for the content item defines the structure that the search component expects. You do not need to provide actual values, as the component populates these values automatically at runtime. For that reason, the example below shows each property with empty double‑quoted values.
The searchIndex value must match your source ID.
{
"searchIndex": "fdd88035-ea32-4b6f-a0af-d4e869905c53",
"fieldsMapping": {
"tags":"",
"images":"",
"description":"",
"title":"",
"type":"",
"link":"",
}
}