【发布时间】:2021-11-16 20:09:25
【问题描述】:
我们有一个现有的应用程序,目前使用 Solr 3.6.1 来索引和搜索文档。使用 Solr 3.6.1,一切正常。
我构建了一个 Solr 8.10.1 服务器,当我尝试将文档上传到 8.10.1 中的 Solr 集合时,我收到“数据在根级别无效”错误。任何帮助将不胜感激。 谢谢
代码:
ISolrOperations<GetPHP> solr = ServiceLocator.Current.GetInstance<ISolrOperations<GetPHP>>();
var response =
solr.Extract(
new ExtractParameters(file, nextDocFile)
{
ExtractFormat = ExtractFormat.Text,
ExtractOnly = false,
AutoCommit = true
});
错误日志:
Exception Type: XmlException Error in: http://localhost:63408/document/new_document.aspx?uID=2081&dType=PHP&txtPath=%2fContribution+Folders%2fPHP%2f00+-++CLOSED+FILES%2f01-Intelligence%2f01-Personnel Error Message: Data at the root level is invalid. Line 1, position 1.
Error Source: System.Xml
StackTrace: at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)
at System.Xml.Linq.XDocument.Parse(String text)
at SolrNet.Impl.SolrBasicServer`1.SendAndParseExtract(ISolrCommand cmd)
at SolrNet.Impl.SolrBasicServer`1.Extract(ExtractParameters parameters)
at SolrNet.Impl.SolrServer`1.Extract(ExtractParameters parameters)
at xyz_app.Document.new_document.Upload_File() in
【问题讨论】:
-
来自 ASP.NET C# 应用程序的代码。我的研究表明 Solr 8.x 在我的代码正在寻找 XML 时返回 JSON。我不知道如何在 Solr 提取函数中编写参数。也可能是其他原因导致问题,