为什么我在为 Sitecore 7 重新编制 Solr 搜索索引时出现"unable to write data to the transport connection"错误?



当我尝试使用Solr重新索引Sitecore 7网站时。我在Solr日志中得到以下错误。

10232 09:10:03警告爬网程序:AddRecursive DoItemAdd失败-{550B5CEF-242C-463F-8ED5-983922A39863}异常:System.IO.IOException消息:无法将数据写入传输连接:远程主机已强制关闭现有连接。来源:系统位于System.Net.Sockets.NetworkStream.Write(Byte[]缓冲区,Int32偏移量,Int32大小)位于System.Net.ConnectStream.InteralWrite(布尔异步、Byte[]缓冲区、Int32偏移量、Int32大小、AsyncCallback回调、对象状态)在System.Net.ConnectStream.Write(Byte[]缓冲区,Int32偏移量,Int32大小)在SolrNet.Impl.SolrConnection.CopyTo(流输入,流输出)位于SolrNet.Impl.SolrConnection.PostStream(字符串relativeUrl,字符串contentType,流内容,IEnumerable`1参数)位于SolrNet.Impl.SolConnection.Post(字符串relativeUrl,字符串s)位于SolrNet.Impl.SolrBasicServer`1.SendAndParseHeader(ISolrCommand cmd)位于Sitecore.ContentSearch.SolrProvider.SolrBatchUpdateContext.AddRange(IEnumerable`1 group,Int32 groupSize)位于Sitecore.ContentSearch.SolrProvider.SolrBatchUpdateContext.AddDocument(Object itemToAdd,IExecutionContext[]executionContexts)位于Sitecore.ContentSearch.SitecoreItemCrawler.DoAdd(IProviderUpdateContext上下文,SitecoreIndexeableItem可索引)位于Sitecore.ContentSearch.HhierarchicalDataCrawler`1.CrawlItem(元组`3元组)嵌套异常异常:System.Net.Sockets.SocketException消息:远程主机强制关闭了现有连接来源:系统位于System.Net.Sockets.NetworkStream.Write(Byte[]缓冲区,Int32偏移量,Int32大小)

你知道为什么会发生这种事吗?

尝试通过浏览http://yoursolrinstance/solr/#/~logging 查看您的解决方案日志,以查找SolrCore中的任何错误

我发现Solr对dynamicField类型生成的字段有问题。

在我的例子中,Solr正在寻找'myfieldname_t_cs',并为cs-CZ语言中的项抛出和'unknown field'异常。

solr schema.xml中的动态字段定义有一个定义了<dynamicField name="*_t_cz" type="text_cz" indexed="true" stored="true" />的字段,但没有映射_cs后缀的字段,所以我添加了<dynamicField name="*_t_cs" type="text_cz" indexed="true" stored="true" />重新启动Tomcat并重建了索引,这个错误被清除了。

我也有关于波兰语内容的Solr错误,因为这是一种根本没有定义语言区域信息的语言,挪威的字段在schema.xml中定义为<dynamicField name="*_t_no" type="text_no" indexed="true" stored="true" />,但Solr正在搜索后缀'*_nb',例如未知字段'id_t_nb',并引发未知字段异常。

Sitecore和Solr使用区域信息映射语言的方式似乎有问题。我将向Sitecore支持提出问题,并在收到回复时更新答案。

你在错误中提到中文可能是因为Solr中没有定义中文,但你在Sitecore中有一些使用该语言的内容。

更新

Sitecore已确认此行为为错误

我发现在生成搜索模式和更新索引时使用了不同的属性(语言和文化的名称)。我将此行为注册为bug,并注册要实现的愿望完全支持SOLR默认支持的语言。

相关内容

最新更新