Sitecore Experience Accelerator

Configure SXA indexing

Abstract

Define the index per site or language.

SXA lets you define index per specific language, or site. This can be convenient when you want to separate data to keep the index small and increase performance.

To add an index:

  1. Navigate to /sitecore/content/Tenant/Site/Settings/Site Grouping/Site.

  2. In the Indexing section, you can enter your index specifications for the site. Always start with the database followed by a slash. You can then specify the language or use an * to include all languages.

    For example, you can create site specific indexes or you can separate between the English and Spanish language:

    SXA-indexing.png

    Note

    If you want to configure an SXA search index to include items of a single specific language, you must add a language parameter for the crawler:

    <locations hint="list:AddCrawler">
        <crawler type="Sitecore.XA.Foundation.VersionSpecific.Search.SxaItemCrawler, Sitecore.XA.Foundation.VersionSpecific">
            <Database>master</Database>
            <Root>/sitecore</Root>
            <Language>en</Language>
        </crawler>
    </locations>
  3. Go to your search provider config file to add the indexes you created. For example, if you use Solr, go to: C:\inetpub\wwwroot\Site\Website\App_Config\Include\Z.Foundation.Overrides\Sitecore.XA.Foundation.Search.Solr and add your index.

The default crawler path is <Root>/sitecore</Root>. When you configure the item crawler paths in your custom indexes to use a different path than the default path (for example: <Root>/sitecore/content/TenantA/SiteA/Home/NewFolder</Root>), this has the following impact:

  • only items from that path are indexed

  • your custom index will not contain templates

Missing templates in the index may impact the fields types resolving logic. In some cases, the field type may not be found and this can generate issues while searching or filtering results. To resolve this, you must manually define all custom fields in the configuration files so that Sitecore knows what types they use (string, integer, text, and so on).

SXA-Indexing-custom-fields.png

Note

For general information on Sitecore indexing, please refer to the Platform documentation.