【问题标题】:Invalid UTF-8 middle byte error when creating a document in WebSolr在 WebSolr 中创建文档时出现无效的 UTF-8 中间字节错误
【发布时间】:2016-10-27 18:12:08
【问题描述】:

我正在使用 SolrJ 6.2.1 并尝试在 WebSolr 索引上创建文档,但是当我尝试将文档添加到索引时,我不断收到以下错误。

错误:来自https://index.websolr.com/solr/XXXXXXX 的服务器错误: 无效的 UTF-8 中间字节 0xe0(在字符 #1,字节 #-1)

这是我为创建索引而编写的 SolrJ 代码:

String urlString = "https://index.websolr.com/solr/a056f416ce0";
SolrClient solr = new HttpSolrClient.Builder(urlString).build();

SolrInputDocument document = new SolrInputDocument();
document.addField("id", "552199");

UpdateResponse response = solr.add(document);

solr.commit();

最初设置索引时,我还在 WebSolr 中使用“自定义”索引类型。

有什么想法我可能在这里做错了吗?

谢谢,

【问题讨论】:

标签: utf-8 solr solrj websolr


【解决方案1】:

通过 HTTP GET 请求:

https://index.websolr.com/solr/admin/info/system

使用 admin/passwd 可以检索服务器配置,结构的 lucene 键包含版本号。

例如使用json输出:

https://index.websolr.com/solr/admin/info/system?wt=json

lucene: {
   solr-spec-version: "4.10.2",
   solr-impl-version: "4.10.2 1634293 - mike - 2014-10-26 05:56:21",
   lucene-spec-version: "4.10.2",
   lucene-impl-version: "4.10.2 1634293 - mike - 2014-10-26 05:51:56"
}

所以你应该使用 SolrJ ver. 4.10.2

【讨论】:

    【解决方案2】:

    想出了这个。

    此时,WebSolr 要求您使用 SolrJ 3.6.1,您的客户端应用程序才能对其进行查询或索引。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多