Solr - 使用UTF-8字符的索引错误

时间:2015-04-20 17:43:01

标签: solr

我是Solr的100%新手。我为Windows安装了solr-5.1并遵循了教程。

我需要指出可能导致以下错误的原因,例如:需要将配置添加到核心xml文件,UTF-8编码问题等...

使用以下方式启动solr:] solr.cmd -start

创建核心:] solr create -c myExample

索引pdf文件:] jar -Dc=myexample -Dfiletypes=pdf -jar ../example/exampledocs/post.jar E:\solr_docs\*.pdf

错误:

SimplePostTool version 5.0.0

Posting files to [base] url http://localhost:8983/solr/myExample/update using content-type application/xml...
POSTing file Intrusion detection by machine learning.pdf to [base]
SimplePostTool: WARNING: Solr returned an error \#400 (Bad Request) for url: http://localhost:8983/solr/myExample/update
SimplePostTool: WARNING: Response: <?xml version="1.0" encoding="UTF-8"?>
<response><lst name="responseHeader">
<intname="status">400</int><intname="QTime">0</int>
</lst><lst name="error"><str name="msg">Invalid UTF-8 middle byte 0xe3 (at char
\#10, byte \#-1)</str><int name="code">400</int></lst>
</response>

1 个答案:

答案 0 :(得分:0)

如果是文本文件,您正在为Solr提供PDF文件。您需要配置和使用合适的URP链以使Solr使用PDF文件。