Search 西班牙语字符的Solr IOR例外(电影示例)
规格:Solr 7.7.1。Ubuntu Linux 18.04 我一直在遵循本教程,只需创建一个solr核心,并从solr打包的films示例发布数据 我使用了命令Search 西班牙语字符的Solr IOR例外(电影示例),search,solr,lucene,Search,Solr,Lucene,规格:Solr 7.7.1。Ubuntu Linux 18.04 我一直在遵循本教程,只需创建一个solr核心,并从solr打包的films示例发布数据 我使用了命令 bin/post-c films example/films/films.xml并在第6个文档上收到以下错误 <str name="msg">ERROR: [doc=/en/quien_es_el_senor_lopez] Error adding field 'name'='¿Quién es el señor Ló
bin/post-c films example/films/films.xml
并在第6个文档上收到以下错误
<str name="msg">ERROR: [doc=/en/quien_es_el_senor_lopez] Error adding field 'name'='¿Quién es el señor López?' msg=For input string: "¿Quién es el señor López?"</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/films/update
如果我尝试在全新的Solr core上导入文件,则会出现相同的错误:
$ solr create -c films
$ post -c films example/films/films.xml
但是,如果我在导入数据之前在核心中添加一个字段,则post将正常工作,如电影示例的README.txt所述:
$ solr delete -c films
$ solr create -c films
$ curl http://localhost:8983/solr/films/schema -X POST -H 'Content-type:application/json' --data-binary '{
"add-field" : {
"name":"name",
"type":"text_general",
"multiValued":false,
"stored":true
},
"add-field" : {
"name":"initial_release_date",
"type":"pdate",
"stored":true
}
}'
$ post -c films example/films/films.xml
错误消息告诉您Solr已经为您提交的字段添加了一个字段类型作为双字段。当您提交的第一个文档的字段中有一个数值,并且您没有添加显式字段类型时,就会发生这种情况,因为这需要Solr猜测字段类型(即无模式模式处于活动状态) 无模式模式对于快速原型化和实验非常有用,但是在导入实际的实时数据时,您应该始终首先定义字段,以避免类似的情况
这也是为什么首先定义字段会按预期工作的原因,因为Solr不必根据字段存在的第一个文档猜测字段类型。Solr端的错误消息是什么?400错误和IOException只是一个post工具,表示服务器响应了一个错误。服务器日志上的错误看起来差不多。我将用其中的一些输出更新这个问题
$ solr delete -c films
$ solr create -c films
$ curl http://localhost:8983/solr/films/schema -X POST -H 'Content-type:application/json' --data-binary '{
"add-field" : {
"name":"name",
"type":"text_general",
"multiValued":false,
"stored":true
},
"add-field" : {
"name":"initial_release_date",
"type":"pdate",
"stored":true
}
}'
$ post -c films example/films/films.xml
Caused by: **java.lang.NumberFormatException**: For input string: "¿Quién es el señor López?"
at sun.misc.**FloatingDecimal**.readJavaFormatString(FloatingDecimal.java:2043)