Solr Connection 'is already registered in the container

I am using solr search on asp.net

when I first search, it gives me the correct search result, bt after that, when I change the search parameter and try to search, give an error ("Solr Connection" is already registered in the container ")

so pl z tell me how can i remove it ...

+4
source share
2 answers

Make sure you only initialize the connection to the Solr instance once by adding something similar to the following in the Application_Start event in Global.asax. file.

Startup.Init ("HTTP: // local: 8983 / Solr");

Can you post a snippet of code on how you open SolrConnection and request a Solr instance? What version of the SolrNet library are you using?

I am using SolrNet version 0.2.3 in an ASP.NET application using the convention described above.

+5
source

My decision is clear. Run before Init

Startup.Container.Clear(); Startup.InitContainer(); Startup.Init<T>("http://localhost:8983/solr/test"); 
+3
source

All Articles