I am migrating a project from 8.2 to 9, and moving indexes from Lucene to Solr. The default indexes are fine, but my custom index is throwing an exception:
53416 08:51:21 ERROR Unable to connect to [https://localhost:8983/solr], Core: [hostname-9u1_search_web_index]
Exception: SolrNet.Exceptions.SolrConnectionException
Message: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /solr/hostname-9u1_search_web_index/schema. Reason:
<pre> Not Found</pre></p>
</body>
</html>
Source: SolrNet
at SolrNet.Impl.SolrConnection.Get(String relativeUrl, IEnumerable`1 parameters)
at Sitecore.ContentSearch.SolrNetExtension.Impl.SolrBasicServerEx`1.GetSchema(String collection)
at Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.InitializeSchema()
at Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.InitializeSolr()
Nested Exception
Exception: System.Net.WebException
Message: The remote server returned an error: (404) Not Found.
Source: System
at System.Net.HttpWebRequest.GetResponse()
at HttpWebAdapters.Adapters.HttpWebRequestAdapter.GetResponse()
at SolrNet.Impl.SolrConnection.GetResponse(IHttpWebRequest request)
at SolrNet.Impl.SolrConnection.Get(String relativeUrl, IEnumerable`1 parameters)
My configuration for the index as follows, which I've basically copied from the standard sitecore_web_index
config and just change the id & core properties:
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes hint="list:AddIndex">
<index id="search_web_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
<param desc="name">$(id)</param>
<param desc="core">hostname-9u1_search_web_index</param>
<param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
<configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
<strategies hint="list:AddStrategy">
<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsyncSingleInstance" />
</strategies>
<locations hint="list:AddCrawler">
<crawler type="Fundamentals.Feature.Search.Infrastructure.Crawlers.LayoutOnlyCrawler, Fundamentals.Feature.Search">
<Database>web</Database>
<Root>/sitecore/Content/SiteName/Home</Root>
</crawler>
<crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
<Database>web</Database>
<Root>/sitecore/Media Library</Root>
</crawler>
</locations>
<enableItemLanguageFallback>false</enableItemLanguageFallback>
<enableFieldLanguageFallback>false</enableFieldLanguageFallback>
</index>
</indexes>
</configuration>
I am new to Solr and my assumption is that this will work in the same way as Azure search; i.e defining the index in config will create the index in Solr without doing any configuration within Solr. Am I missing a step?
UPDATE As per the accepted answer, I was indeed missing a step - unlike Azure search, you need to create the indexes (cores) in Solr. However I had to do something slightly different to the blog post.
The blog post suggests there is a "sitecore_configs" configset - there wasn't in my case, and the config for each core was located within each index under a 'conf' folder. So I just had to copy the contents from the sitecore_web_index into a new folder called 'sitecore_configs'. Then I could call the URL as suggested. Then I used the 'Populate Solr Managed Schema' command from the control panel in Sitecore, and then rebuilt.
Error CREATEing SolrCore 'hostname-9u1_search_master_index': Unable to create core [hostname-9u1_search_master_index] Caused by: Can't find resource 'solrconfig.xml' in classpath or 'C:\Solr\solr-6.6.2\server\solr\hostname-9u1_search_master_index'