The FFW team works with more than just Drupal and WordPress. We've built some award-winning Sitecore solutions as well, and in this Sitecore blog series, we'll be sharing our insights on refining Sitecore's search functionality to enhance the user experience.
On a Sitecore platform, search performance depends very much on the size of the indexed data within the search index. A smaller index means faster searching, faster indexing of the data, and easier maintenance. Here are some tips on how to decrease the Sitecore search and indexing time in your search implementations.
Before you try these tips out, remember: Always using the same developing technique is not a good approach to software development because the same technique is not the best one for all cases. Every implementation very much depends on the requirements, and one solution simply cannot fit perfect everywhere.
For example, if you have a presentational website that barely utilizes the Sitecore search, it’s probably good enough to stick with the default Sitecore search indexes (sitecore_master(web)_index) because the optimal search performance is not of such importance.
Conversely, if you are working on a website that has functionality that highly depends on the search, then you should definitely consider improving the search and indexing speed as much as possible. Creating custom indexes is highly valuable exactly in these scenarios when many features within your solutions rely on the Sitecore search and you are processing huge amount of data.
How to create a custom index
It’s always easier to just use sitecore_master_index/sitecore_web_index, but these default Sitecore indexes are bloated with data, which will slow down your indexing and search times. Additionally, it's not a good practice to start excluding templates and fields from the default Sitecore indexes because some bugs could be introduced. Instead, create a custom index which will contain only the data you need.
A good approach is to utilize the domain index pattern and organize the indexes based on the business domains and configure a new index for each domain, where the data is stored in the most optimal way. You can see examples for that even in the default Sitecore indexes (marketing_assets_index, fxm, xdb, etc.), which are actually organized according to the domain index pattern.
Index only the required templates and fields
Another useful tip is this: index only what you intend to search. You can exclude templates and fields from being indexed – this can be done not just for your custom templates and fields, but also for the ones coming from Sitecore’s templates (workflow, help text, validation rules, security, etc.). Here are the high-level guidelines on how to build your custom index configuration:
- Reference the <defaultSolrIndexConfiguration> from your custom index configuration
- Clear <documentOptions> and <virtualFields>
- Set <indexAllFields> to false
- Include only the templates and fields you need using <include> and <exclude> elements
Here is the documentation about indexing configuration files and a great example by Bartłomiej Mucha on how to build your custom index configuration.
Index only required content locations
You can configure your index crawlers to include only the portion that it needs to crawl and index.
It is done by adding crawlers within the <locations> element in your index configuration. For example:
<crawler name="content" type="Sitecore.ContentSearch.SitecoreItemCrawler,Sitecore.ContentSearch">
<crawler name="media" type="Sitecore.ContentSearch.SitecoreItemCrawler,Sitecore.ContentSearch">
Want to learn more about improving your indexing in Sitecore? Here's a few resources and further reading that I'd recommend:
- Improving domain index pattern: a great blog post by Søren Engel.
- Optimizing Sitecore Indexing Performance: a great blog post by Jinto Varghese.
If you enjoyed this blog post, please don’t forget to check the Sitecore Search Series: Your Complete Guide to Performance Improvement blog series for more good tips!
In case, you have more Sitecore Search Performance tips, feel free to put them as comments below!