当我尝试将我的json文件索引到solr时,我遇到以下错误:
SimplePostTool: WARNING: Solr returned an error #400 (Bad Request) for url: http
://localhost:8983/solr/ontoneo/update
SimplePostTool: WARNING: Response: {
"responseHeader":{
"status":400,
"QTime":16},
"error":{
"metadata":[
"error-class","org.apache.solr.common.SolrException",
"root-error-class","org.apache.solr.common.SolrException"],
"msg":"Error parsing JSON field value. Unexpected OBJECT_START at [138], fie
ld=http://www.w3.org/2002/07/owl#intersectionOf",
"code":400}}
SimplePostTool: WARNING: IOException while reading response: java.io.IOException
: Server returned HTTP response code: 400 for URL: http://localhost:8983/solr/on
toneo/update
1 files indexed.
COMMITting Solr index changes to http://localhost:8983/solr/ontoneo/update...
Time spent: 0:00:00.146
我的json文件的第138行显示如下:
{
"@id" : "_:genid117",
"@type" : [ "http://www.w3.org/2002/07/owl#Class" ],
"http://www.w3.org/2002/07/owl#intersectionOf" : [ {
"@list" : [ {
"@id" : "_:genid121"
}, {
"@id" : "_:genid119"
} ]
} ]
},
我对它进行了一些研究,发现问题是多值的字段列表。尝试修复它我已将值字段添加到我的集合中的文件managed-schema.xml
中。代码行如下所示:
<field name="list" type="text_general" multiValued="true" indexed="true" stored="true"/>
但是当我运行solr索引时,问题仍然存在。出了什么问题?
答案 0 :(得分:-1)
似乎您定义了“text_general”类型的字段,但随后将JSON数据传递给索引。你的意思是索引“JSON字符串”而不是JSON对象吗?