Sitecore 9 : An index with the name "sitecore_core_index" have already been added Issue

Server Error in '/' Application.


An index with the name "sitecore_core_index" have already been added.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: An index with the name "sitecore_core_index" have already been added.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace: 

[InvalidOperationException: An index with the name "sitecore_core_index" have already been added.]
   Sitecore.Diagnostics.Assert.IsFalse(Boolean condition, String message) +81
   Sitecore.ContentSearch.ContentSearchConfiguration.AddIndex(ISearchIndex index) +182

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +210
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146
   Sitecore.Configuration.DefaultFactory.AssignProperties(Object obj, Object[] properties) +836
   Sitecore.Configuration.DefaultFactory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +622
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +320
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72
   Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) +731
   Sitecore.ContentSearch.ContentSearchManager.get_SearchConfiguration() +305
   Sitecore.ContentSearch.SolrProvider.SolrContentSearchManager.get_Cores() +91
   Sitecore.ContentSearch.SolrProvider.SolrNetIntegration.DefaultSolrStartUp.Initialize() +421
  • Please verify whether you have two indexes with same name (sitecore_core_index) from show config page <hostname>/sitecore/admin/showconfig.aspx. I guess, Sitecore.ContentSearch.Lucene.Index.Core.config and Sitecore.ContentSearch.Solr.Index.Core.config both files are enabled and thus it is causing the issue.
  • In reply to DHEER Rajpoot:

    Thanks for your response Dheer. Yes indeed you are right I had both the files in Appconfig/Sitecore/ContentSearch Folder. I had removed those but now I am getting index issue for marketingdefinations

    Server Error in '/' Application.
    An index with the name "sitecore_marketingdefinitions_master" have already been added.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: An index with the name "sitecore_marketingdefinitions_master" have already been added.

    I also searched for all marketingdefinations config and removed but still get this issue.

    Deepak Dosaya
  • In reply to Deepak Dosaya:

    You should not remove/disable both config files Sitecore.ContentSearch.Lucene.Index.Core.config and Sitecore.ContentSearch.Solr.Index.Core.config as sitecore_core_index index is required for Sitecore. If you are using SOLR then enable Sitecore.ContentSearch.Solr.Index.Core.config and disable Sitecore.ContentSearch.Lucene.Index.Core.config.

    sitecore_marketingdefinitions_master is defined in Sitecore.Marketing.Solr.Index.Master.config and Sitecore.Marketing.Lucene.Index.Master.config files. Disable lucene index file if you are using SOLR as search provider otherwise disable SOLR index file if you are using Lucene.
  • In reply to DHEER Rajpoot:

    Dheer,

    I am assuming, from Sitecore 9 it is role based. Then why we need to remove those config files manually?
  • In reply to Ganesh Subramanian:

    Any update why the search:require is not working as expected?