We were using docker based Sitecore 10.1 for local development. This was an upgrade project and I was working on validating the items in upgraded Sitecore 10.1 environment.
Problem
I started performing some simple searches in Content Editor's search box but got no results returned even when the item existed in the content tree. I realized I have never built the SOLR indexes since I setup the environment. So I went to control panel and attempted index rebuild. I got the following error -
Job started: Index_Update_IndexName=sitecore_master_index|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> SolrNet.Exceptions.SolrConnectionException: <?xml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"> <int name="rf">1</int> <int name="status">400</int> <int name="QTime">4</int> </lst> <lst name="error"> <lst name="metadata"> <str name="error-class">org.apache.solr.common.SolrException</str> <str name="root-error-class">org.apache.solr.common.SolrException</str> </lst> <str name="msg">undefined field _indexname</str> <int name="code">400</int> </lst> </response> ---> System.Net.WebException: The remote server returned an error: (400) Bad Request. at System.Net.HttpWebRequest.GetResponse() at HttpWebAdapters.Adapters.HttpWebRequestAdapter.GetResponse() at SolrNet.Impl.SolrConnection.GetResponse(IHttpWebRequest request) at SolrNet.Impl.SolrConnection.PostStream(String relativeUrl, String contentType, Stream content, IEnumerable`1 parameters) --- End of inner exception stack trace --- at SolrNet.Impl.SolrConnection.PostStream(String relativeUrl, String contentType, Stream content, IEnumerable`1 parameters) at SolrNet.Impl.SolrConnection.Post(String relativeUrl, String s) at SolrNet.Impl.LowLevelSolrServer.SendAndParseHeader(ISolrCommand cmd) at Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.PerformReset(ISolrOperations`1 operations, String indexName) at Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.PerformRebuild(Boolean resetIndex, Boolean optimizeOnComplete, IndexingOptions indexingOptions, CancellationToken cancellationToken) at Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.Rebuild(Boolean resetIndex, Boolean optimizeOnComplete) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj) at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args) at (Object , Object ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) at Sitecore.Jobs.DefaultJob.DoExecute() at Sitecore.Abstractions.BaseJob.ThreadEntry(Object state)
Solution
Due to the changes to the SOLR container format, the schema needs to be populated the first time after the instance is first spun up.
Go to the Control Panel, select Populate Managed Solr Schema, select all the indexes and hit Populate and then wait...
After the indexes get successfully populated, you can go back and rebuild the indexes successfully.
Comments
Post a Comment