Debugging Your Sitecore Search Integration on Next.js and Sitecore XM Cloud

Understand where to investigate and what to play around with to try and tweak your Sitecore Search to your needs

October 9, 2024

By John Flores

How to Effectively Troubleshoot and Optimize Your Sitecore Search Integration

Sitecore Search is a unique and powerful tool, but integrating it into your project may present certain challenges. You might be wondering how to customize and fine-tune it to meet your specific needs. There are limited resources available that provide direct solutions to your challenges. The best way to find answers is by getting hands-on and experimenting with the tool yourself.

Now, you might be wondering where you should start your investigation on the possible problems in your integration. Aside from going through your widget code, there are two places you can also look into that will help you understand how Sitecore Search fits into your project.

Check Out the Browser’s Network Tab

Screenshot of a request payload preview showing the structure of a search query with widget configurations and parameters.

While using your website’s Network Tab, look for an entry with a Request URL that starts with https://discover.sitecorecloud.io/discover/ . These are the API calls that are made with your Sitecore Search widgets. Under Payload tab you will see a key named widgets, and you’ll be able to check if you are passing the right information in order to get your desired output.

Screenshot of a JSON payload preview displaying widget data and configurations used in a web page or application interface.

Under the Preview tab, you will see what content are being returned for each widget. You can look into what widget is broken and what errors are returned for each one. Each widget also gets their own list of content respective to the settings passed.

Check Out the Customer Engagement Console (CEC)

You can also take a look at Sitecore’s Customer Engagement Console for Sitecore Search. There are multiple of key factors here that might help you create work arounds for your problem.

Project Attributes

Under the Administration tab, you will see all the attributes available in your project. Some of the core functionality of how the project works can be dependent on how you’ve set these up. One of which is the Textual Relevance. This can affect how key phrases and the simple search will return to the user.

Screenshot of a feature configuration interface showing various application settings such as API Response, Facets, Filters, and Personalization.

You might be wondering why Textual Relevance can affect what is being returned to the user at a top level, regardless of the widget used. You might want to look into the different types of analyzers used on each field. Some of these utilize a preconfigured stop word list which may affect the results you are trying to get. For example Partial match is an analyzer that involves removing stop words in it’s logic. You might have to take a look at the different stop words just incase an important word you are using is in the list. Make sure to contact Sitecore if it is because they will have to configure something on their end or you can just replace the word, or even better look at other analyzers that returns better results.

Another resource you can add into your list is the Storybook setup dedicated for Sitecore Search. This contains a lot of useful information you can try and squeeze out of your widgets.

Screenshot of the Sitecore documentation page introducing the Sitecore Search SDK and UI Components for React applications.

They provide details of available actions, parameters and more than enough details on what you can use to setup your widgets.

Screenshot of an action list table detailing various operations available for SDK hooks in a code documentation interface.

It also contains example code for your widget config.

Streamline Your Sitecore Search Integration With These Troubleshooting Tips

Sitecore Search may still be not as popular as some of it’s competitors but streamlining your products to a single ecosystem can be a huge edge in any project. You should not feel less confident with the little resources there are for Sitecore Search since there are enough to provide detailed information on what to do.

John Headshot

John Flores

Front-End Developer

John is a Front-End Developer who is passionate about design and development. Outside of work, John has wide range of hobbies, from his plant collection, being a dog daddy, and a foodie.