
Saurav Kr.
••4 min read
Sitecore Exact Search
Here's a step-by-step guide to implement Sitecore Search in a Sitecore XM Cloud project.




Objective: Integrate Sitecore Search (SaaS product) with XM Cloud (headless CMS) to allow AI-powered search and content discovery on your headless site (e.g., React, Next.js).
Prerequisites
Before starting:
- A Sitecore XM Cloud project set up
- Access to the Sitecore Search portal: https://search.sitecorecloud.io
- Your content should be published and exposed via headless (GraphQL or REST) endpoints
Step-by-Step Integration
Step 1: Log in to Sitecore Search
- Go to: https://search.sitecorecloud.io
- Log in with your Sitecore ID
- Create a new crawler for your content source
Step 2: Configure a Web Crawler (or Feed Crawler)
Sitecore Search uses crawlers to fetch and index your content.
Option A: Web Crawler
- Use this if your content is public and accessible via URLs.
- Click Create Crawler
- Choose Web Crawler
- Set:
-Base URL (e.g., https://yourwebsite.com/blog)
-Include/Exclude rules
4. Define schema mapping for:
-title
-description
-image
-URL
-tags / categories
Option B: Feed Crawler (for headless content)
- If you use Sitecore Headless Services, provide an endpoint that returns a list of content in JSON (e.g., blog posts from GraphQL)
Step 3: Define Schema and Facets
- Go to Schemas
- Map the crawled fields to Sitecore Search schema (title, content, tags, etc.)
- Set up facets (e.g., category, author) if needed
Step 4: Build Search UI (Frontend)
You can use one of the following methods:
Option A: Prebuilt SDK Widgets
- Use JavaScript SDK (easy to embed)
- Add this to your frontend:
<script src="https://unpkg.com/@sitecore-search/js-sdk"></script>
Example (basic search box): <sitecore-search-search-box api-key="your-api-key" environment="prod" placeholder="Search here..." ></sitecore-search-search-box>
Option B: React SDK / Custom UI
Use Sitecore's React SDK for better control.
1. Install SDK:
npm install @sitecore-search/react
2. Use component:
import { SearchBox } from '@sitecore-search/react';
<SearchBox
placeholder="Search..."
onSearch={(query) => console.log(query)}
apiKey="your-api-key"
environment="prod"
/> More components available:
- Search results
- Facets
- Pagination
Step 5: Personalize Search (Optional)
- Go to Projects > Personalization
- Add custom rules for:
- Device type
- Time of day
- Campaign tags
- Location, etc.
3. Show different results or boost certain content
Exact Match Search with Sitecore Search
Understanding Sitecore Search
Let’s take a moment to remember a few concepts in Sitecore Search to understand the configuration better.
- Index Document – A single piece of indexed content such as a webpage, a word document, a pdf, etc.
- Attributes – The fields of an indexed document such as title, subtitle, url, content type, etc.
- Textual Relevance – Defines the attributes used to locate potential results.
- Weight – Defines a relative value for how important an attribute is within the textual relevance.
- Analyzers – Convert the original search query into a format that is optimized for search.
- Token – A chunk of the original search query, usually a single word or phrase that is often modified by the analyzer to include synonyms, remove stop words and reformat to the root word.
Sitecore Search has a number of predefined analyzers built in. Each analyzer processes the search query in different ways.
The default analyzer is the multi local standard analyzer. This analyzer modifies the search query by making it lower case, splitting the search query into single word tokens, finding the root of each word, applying synonyms, and removing punctuation. For this reason, it will not find an exact match. For that we need the keyword analyzer which leaves the search query in a single token without applying any modifications.
Configure Exact Match Search – Textual Relevance
In order to configure exact match search, we need to add the keyword analyzer to the textual relevance settings for the desired attribute, in this case the description.
Navigate to Admin/Domain Settings then click the feature configuration tab.
Domain Settings
Edit the Textual Relevance section.
Textual Relevance Settings
Add the keyword analyzer to the description attribute.
Add Analyzer
Select the keyword analyser
Edit the Textual Relevance section in Global resources.
- Add attribute weight value in global resources->global widget settings->textual relevance
Make sure to save your changes then publish your domain settings for your changes to take effect.
Happy Coding!
S
Saurav Kr.
Technical writer and software development expert at Murmu Software Infotech, sharing insights on modern web development, software architecture, and best practices.

