Search code examples
utf-8solrsolrjwebsolr

Invalid UTF-8 middle byte error when creating a document in WebSolr


I'm using SolrJ 6.2.1 and trying to create a document on the WebSolr index but I keep getting the following error when I try to add the document to the index.

Error: Error from server at https://index.websolr.com/solr/XXXXXXX: Invalid UTF-8 middle byte 0xe0 (at char #1, byte #-1)

Here's the SolrJ code that I've written to create the Index:

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();

I'm also using the "customized" index type in WebSolr when setting up the index initially.

Any ideas what I maybe doing wrong here?

Thanks,


Solution

  • With an HTTP GET request to:

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

    with the admin/passwd you can retrieve the server configuration, the lucene key of the structure contains version numbers.

    For example, using json output:

    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"
    }
    

    So you should use SolrJ ver. 4.10.2