Hi Everyone, Im fairly new to use of solr and solrnet. I had a question
var solrFacility = new SolrNetFacility(ConfigurationSettings.ContentSearch_Solr_ServiceBaseAddress);
solrFacility.AddCore(AgentsIndexName.IndexName, typeof(AgentsIndex), ConfigurationSettings.ContentSearch_Solr_ServiceBaseAddress +"/"+ AgentsIndexName.IndexName);
IOC.Container.AddFacility("solr", solrFacility);
Following is the code I have written. the index is mapped to a class named AgentsIndex. Can I map this to its interface?
Would that be a good practice?
I wanna map it to an interface so I can use my generic crawler.
public abstract class Crawler<T> : ICrawler<T>
{
public void RebuildIndex(ISolrOperations<T> indexOperations, IEnumerable<T> indexMapper)
{
}
}
public class AgentsIndexCrawler : Crawler<IAgentsIndexMapper>
{
public override void RebuildIndex(ISolrOperations<IAgentsIndexMapper> indexOperations, IEnumerable<IAgentsIndexMapper> indexMapper)
{
ISolrOperations<IAgentsIndexMapper> indexOperationss = IOC.Container.Resolve<ISolrOperations<IAgentsIndexMapper>>();
base.RebuildIndex(indexOperationss, agentListing);
}
}
Thanks,
Kasturi Chavan