Sitecore with Solr – required configuration

In this post I will provide you some information about configuration of your Sitecore for work with Solr server.

Probably everyone who faced with that task, found the most popular and really good guide from sitecore-community.github.io (click).

But there is a one more thing which should be made. About this additional configuration I will write today.

We have to configure our Inversion of Control containers.

When we want to use Sitecore with Solr we have to configure at lease two inversion of control containers to work parallel. (Autofac and Windsor).

So lets do it!

Open your Global.asax.cs file and check your MvcApplication class definition – it should extend a WindsorApplication. So code will look in the following way:

public class MvcApplication : WindsorApplication

Ok, the next step is initialization code for your containers. This code should looks like:

public override void Application_Start()
        {            
            this.Container = (IWindsorContainer)new WindsorContainer();
            new WindsorSolrStartUp(this.Container).Initialize();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
 
            AutofacConfig.RegisterConfiguration();
        }

When you have your application configured in this way you may be sure that Sitecore tools (like administration panel) and communication with Solr server will work properly.

Well and the last but not least thing – check your Global.asax file – code inside it should look like:

<%@ Application Codebehind="Global.asax.cs" Inherits="<PROJECT_NAMESPACE>.MvcApplication" Language="C#" %>​

If you have any questions or problems, do not hesitate to ask or comment bellow the post.

 

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz