我正在尝试使用SolrNet从Web服务搜索Solr服务器。我在global.asax:Startup.Init<ApartmentDoc>("http://192.168.0.100:8080/solr/");
我正在尝试通过以下方式在类文件中查询服务器:
var solr = ServiceLocator.Current.GetInstance<ISolrOperations<ApartmentDoc>>();
var apartments = solr.Query(SolrQuery.All, new QueryOptions
{
ExtraParams = new Dictionary<string, string> {
{ "defType", "edismax" } ,
{ "fl", "*,score,_dist_:geodist() " } ,
{ "bf", "recip(geodist(),1,1000,1000)" } ,
{ "fq", string.Format("{{!geofilt d={0}}}", radius * 1.609344) } ,
{ "sfield", "Location" } ,
{ "pt", string.Format("{0},{1}", centerLat, centerLong) }
}
});
return apartments;
我得到的错误是:Unable to read data from the transport connection: The connection was closed.
我已经检查了TomCat中的日志,并且请求正在进行,结果似乎已经返回。
为什么我没有得到结果的任何想法?
谢谢, 德鲁
答案 0 :(得分:2)
由于代码中未定义“rows”参数,因此尝试检索大量文档时,请求可能会超时。 As explained in the SolrNet documentation, always define pagination parameters