So a SOLR search tool I designed recently decided to stop working for no apparent reason with the follow error description.
An error occurred while performing an operation in the Search Engine library. Error getting collection information.: org.apache.solr.common.SolrException: no_segments_file_found_in_orgapachelucenestore
Yeah that helps a bunch.
Any attempts to rebuild the collection failed so I went digging. After a few google searches I discovered that there is a web console for SOLR you can access to help with debugging.
The first step in debugging this is to login to the SOLR administrator web console from a web browser on the servers remote desktop. On a default install this can be accessed at: http://127.0.0.1:8983/solr/
Navigating to this url will display a list of search collections. Click through to each one and you will be presented with this screen.
Click through to "Config" presented me with this error:
HTTP ERROR: 400
Can not find: solrconfig.xml [D:\Domains\{collection file path}\conf\solrconfig.xml]
RequestURI=/solr/{collection name}/admin/file/
It seems that somehow the "solrconfig.xml" file had been deleted. This appears to be a known issue with SOLR itself. The most common (but not only) cause is someone deleting the solr collection files without first removing the collection from the system.
In addition as a bonus, breaking one solr collection actually breaks them all.
The are two ways of fixing this error. The best solution of course is to restore the missing file from backup.
However if like in this case you don't have access to a backup of the file your other option is to delete the reference to the collection from the main "solr.cml" file. This file location can be seen in the SOLR admin console at the CWD location. For reference depending on your version of ColdFusion the file can be found here:
C:\ColdFusion9\solr\multicore\solr.xml
C:\JRun4\servers\[server instance]\cfusion-ear\cfusion-war\WEB-INF\cfusion\solr\multicore\solr.xml
Open this file and delete the reference for the collection in question. Save the changes, delete the actual collection files from the system and then restart the SOLR service.
You should now be able to recreate the collection.