Winwdows solr post - Invalid UTF-8 middle byte 0xe3 (at char #10, byte #-1)

两盒软妹~` 提交于 2020-05-17 08:47:01

问题


My code c2020 is running and available what I visit http://localhost:8983/solr/#/c2020/query.

Locally, when I try to run:

solr-7.7.2> java -jar -Dc=c2020 example\exampledocs\post.jar "C:\temp\path_to\a_doc.pdf"

I get:

SimplePostTool version 5.0.0
Posting files to [base] url http://localhost:8983/solr/c2020/update using content-type application/xml...
POSTing file A Half Century of Macro Momentum_vf.pdf to [base]
SimplePostTool: WARNING: Solr returned an error #400 (Bad Request) for url: http://localhost:8983/solr/c2020/update
SimplePostTool: WARNING: Response: <?xml version="1.0" encoding="UTF-8"?>
<response>

<lst name="responseHeader">
  <int name="status">400</int>
  <int name="QTime">6</int>
</lst>
<lst name="error">
  <lst name="metadata">
    <str name="error-class">org.apache.solr.common.SolrException</str>
    <str name="root-error-class">java.io.CharConversionException</str>
  </lst>
  <str name="msg">Invalid UTF-8 middle byte 0xe3 (at char #10, byte #-1)</str>
  <int name="code">400</int>
</lst>
</response>
SimplePostTool: WARNING: IOException while reading response: java.io.IOException: Server returned HTTP response code: 400 for URL: http://localhost:8983/solr/c2020/update
1 files indexed.
COMMITting Solr index changes to http://localhost:8983/solr/c2020/update...
Time spent: 0:00:00.310

Now, if I run:

java -Durl=http://localhost:8983/solr/c2020/update/extract -jar example\exampledocs\post.jar "C:\temp\path_to\a_doc.pdf"

It works:

SimplePostTool version 5.0.0
Posting files to [base] url http://localhost:8983/solr/c2020/update/extract using content-type application/xml...
POSTing file a_doc.pdf to [base]
1 files indexed.
COMMITting Solr index changes to http://localhost:8983/solr/c2020/update/extract...
Time spent: 0:00:14.647

But it does not send all "fields" I want to see such as the file path or the file name.

I'd like to get the raw post doc to work if anyone could advise.

来源:https://stackoverflow.com/questions/61510883/winwdows-solr-post-invalid-utf-8-middle-byte-0xe3-at-char-10-byte-1

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!