0

我正在使用 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 中使用“自定义”索引类型。

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

谢谢,

4

2 回答 2

0

使用 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 版本。4.10.2

于 2016-10-28T13:15:00.970 回答
0

想出了这个。

目前,WebSolr 要求您在 SolrJ 3.6.1 上为您的客户端应用程序查询或索引它。

于 2016-10-27T19:42:22.460 回答