Using StructureMap with Solrnet – updated

The implementation has now been updated to allow for multi-core instances. Which can be set up in your Bootstrapper like this:

var solr = (SolrConfigurationSection)ConfigurationManager.GetSection(“solr”);
var solrServers = solr.SolrServers;
ObjectFactory.Initialize(
x => x.AddRegistry(new SolrNetRegistry(solrServers))
);

You’re app config should look like the the following:

<configuration>
<configSections>
<section name="solr"
    type="StructureMap.SolrNetIntegration.Config.SolrConfigurationSection, SolrNet" />
</configSections>
<solr>
<server id="myobject" url="http://localhost:8080/solr/"
documentType="Your.Objects.Name, Your.Objects.Namespace" />
</solr>
</configuration>
Advertisements