本文整理汇总了C#中SolrNetFacility.AddCore方法的典型用法代码示例。如果您正苦于以下问题:C# SolrNetFacility.AddCore方法的具体用法?C# SolrNetFacility.AddCore怎么用?C# SolrNetFacility.AddCore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SolrNetFacility
的用法示例。
在下文中一共展示了SolrNetFacility.AddCore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddCore
public void AddCore()
{
const string core0url = "http://localhost:8983/solr/core0";
const string core1url = "http://localhost:8983/solr/core1";
var solrFacility = new SolrNetFacility("http://localhost:8983/solr/defaultCore");
solrFacility.AddCore("core0-id", typeof(Document), core0url);
solrFacility.AddCore("core1-id", typeof(Document), core1url);
solrFacility.AddCore("core2-id", typeof(Core1Entity), core1url);
var container = new WindsorContainer();
container.AddFacility("solr", solrFacility);
TestCores(container);
}
示例2: SetConnectionTimeoutInMulticore
public void SetConnectionTimeoutInMulticore()
{
const string core0url = "http://localhost:8983/solr/core0";
const string core1url = "http://localhost:8983/solr/core1";
var solrFacility = new SolrNetFacility("http://localhost:8983/solr/defaultCore");
solrFacility.AddCore("core0-id", typeof(Document), core0url);
solrFacility.AddCore("core1-id", typeof(Document), core1url);
solrFacility.AddCore("core2-id", typeof(Core1Entity), core1url);
var container = new WindsorContainer();
container.Kernel.ComponentModelCreated += model => {
if (model.Implementation == typeof(SolrConnection))
model.Parameters.Add("Timeout", "2000");
};
container.AddFacility("solr", solrFacility);
var allTimeouts = container.ResolveAll<ISolrConnection>().Cast<SolrConnection>().Select(x => x.Timeout);
foreach (var t in allTimeouts)
Assert.AreEqual(2000, t);
}