c# - How to execute CoreAdmin commands with SolrNet Unity with Multiple Solr instances? -
i using solrnet version 0.5.1 unity ioc. before performing search or add index operation, when service starts check if solr core created & if rebuild core in case of schema changes. want through c# class library. have registered ioc inside container using following code. can access isolroperations no issues. when try create core, how can resolve headerparser, statusparser required while creating instance of solrcoreadmin? tried searching example in every example, have mentioned initialize solr startup.init<userindexingdata>(solrconfig.url);
not want reinitialize container me. if reinitialize, throws 'connection' registered exception. tried resolving isolrheaderresponseparser & isolrstatusresponseparser instances through container got exception. new ioc & di. appreciated.
private static void registersolrdependencies(iunitycontainer retval) { retval.registertype<ireadonlymappingmanager, memoizingmappingmanager>( new injectionconstructor(new resolvedparameter(typeof(attributesmappingmanager)))); retval.registertype<imappingvalidator, mappingvalidator>(); setconfiguration().getawaiter().getresult(); solrservers servers = new solrservers(); list<isolrconfig> list = configuration.indexingserviceconfiguration.solrconfigurations.tolist(); list.foreach( c => servers.add(new solrserverelement { documenttype = c.documenttype, id = c.id, url = c.url })); new solrnetcontainerconfiguration().configurecontainer(servers, retval); }
Comments
Post a Comment