Search functionality in Sitecore Client may not work if some items are not included into any search index

  • Description

    Sitecore client search-related functionality, such as the Content Tree search, the Start bar search, the Search tab, theMultilist with Search field, etc. may not work properly if the /sitecore item or the item currently selected in Content Tree is not included in any search indexes.

    The following exception may appear in the Sitecore log files:

    Exception: System.ArgumentNullException
    Message: Value cannot be null.
    Parameter name: key
    Source: mscorlib
       at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
       at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
       at Sitecore.ContentSearch.ContentSearchManager.GetIndex(String name)

    The issue may occur when:

    • The /sitecore or the currently selected item is located outside of the crawler root of any index, for example,
      <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
        <indexes hint="list:AddIndex">
          <index id="sitecore_master_index" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
          ...
            <locations hint="list:AddCrawler">
              <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
                <Database>master</Database>
                <Root>/sitecore/content/Home</Root>
              </crawler>
    • The template of the currently selected item is in the <exclude hint="list:ExcludeTemplate"> section in the search configuration
    • The template of the currently selected item is not in the <include hint="list:IncludeTemplate"> section, if configured to do so
  • To fix the issue apply the patch below:

    1. Copy the Sitecore.Support.425362.dll assembly to the \bin directory of your website.
    2. Copy the Sitecore.Support.425362.config file to the \App_Config\Include directory of your website.

    The patch introduces a DefaultMasterDBIndexName setting, which is set to sitecore_master_index by default.
    The index specified in this setting will be used as a fallback when no context index is found for the particular search operation in Sitecore Client. This index should cover the entire master database to prevent the issues described in the article.

Applies to:

CMS 7.2+

December 03, 2015
December 03, 2015

Reference number:

417434, 417437, 417893, 422871, 425362, 454090, 454093

Keywords: 

  • Search and Indexing