I got a scenario where solr connections are working fine in Sitecore CMS where it is giving some issue in Content Delivery. We have defensive code in place where we check if sitecore content indexing search returns null we get it from CMS. Now Is there a way in configuration where we can just set search enabled =false or something which can stop referring to solr server.

  • did you installed patch for SOLR to not crash your site if Solr is down ? – Vlad Iobagiu Apr 27 '17 at 8:41
  • Is this patch related to sitecore 8.2.1? – Santosh Poojari Apr 28 '17 at 5:18

I don't know of any way to turn off search that has already been configured through the proper configs. You could just do something like this in your search queries and turn them on and off in Sitecore or an settings config.

using (var context = ContentSearchManager.GetIndex("sitecore_web_index").CreateSearchContext())
     var searchOn = true; // pull this from Sitecore or Setting

     var query = context.GetQueryable<SearchResultItemBase>()
                .Where(item => item.Path.StartsWith(startPath)
                               && true == searchOn);
| improve this answer | |
  • This is will be taken care when it tries to search but during application start it tries to connect to solr end point and it throws error connection failed. I want to tackle this scenario. Like for mongo we have something like this <setting name="Xdb.Enabled" value="true" /> – Santosh Poojari Apr 27 '17 at 4:20
  • Kind of like this circuit breaker for Geo Ip. redmoon.london/… I have never does it for search, but maybe that article will help. – Chris Auer Apr 27 '17 at 4:59

I would try to disable search configuration files. You can see the complete list here.

Another quick option is to patch InitializeSolrProvider processor:

<patch:instead="*[@type='Sitecore.ContentSearch.SolrProvider.Pipelines.Loader.InitializeSolrProvider, Sitecore.ContentSearch.SolrProvider']" />
| improve this answer | |
  • You mean only solr configuration or all the configuration listed for search? I will give a try for InitializeSolrProvider for now. Thanks – Santosh Poojari May 1 '17 at 3:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.