我是SOLR的新手,仍然试图解决它。 我有一些个人抓取的数据,我使用this thread中的代码将其转换为SOLR的xml字段格式。
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<add>
<doc>
<field name="ID">1</field>
<field name="FULL_MESSAGE">[CNA] Independent adviser recommends shareholders accept offer for SingLand http://t.co/OEiftRyl7N</field>
<field name="SOURCE">CNA</field>
<field name="NEWS">Independent adviser recommends shareholders accept offer for SingLand </field>
<field name="LINK">http://t.co/OEiftRyl7N</field>
</doc>
<doc>
<field name="ID">2</field>
<field name="FULL_MESSAGE">[ST] Australia's foreign minister updates PM Lee on reverse Colombo Plan http://t.co/bc7ZHCztW5</field>
<field name="SOURCE">ST</field>
<field name="NEWS">Australia's foreign minister updates PM Lee on reverse Colombo Plan </field>
<field name="LINK">http://t.co/bc7ZHCztW5</field>
</doc>
<doc>
<field name="ID">3</field>
<field name="FULL_MESSAGE">[CNA] Grace Fu meets China�s NPC vice chairperson http://t.co/6k9CLe4c1x</field>
<field name="SOURCE">CNA</field>
<field name="NEWS">Grace Fu meets China�s NPC vice chairperson </field>
<field name="LINK">http://t.co/6k9CLe4c1x</field>
</doc>
.
.
.
但是当我尝试将xml导入SOLR时,它一直给我这个错误:
SimplePostTool: WARNING: Solr returned an error #400 Bad Request
SimplePostTool: WARNING: IOException while reading response: java.io.IOException
: Server returned HTTP response code: 400 for URL: http://localhost:8983/solr/update
我完全不知道这意味着什么。我的XML格式不正确吗?或者是其他东西? 提前致谢
编辑:以下是我对schema.xml所做的更改。但是,它仍会产生相同的错误
<fields>
<!-- Custom Fields -->
<field name="ID" type="int" indexed="true" stored="true" required="true" multiValued="false" />
<field name="FULL_MESSAGE" type="string" indexed="true" stored="true" />
<field name="SOURCE" type="string" indexed="true" stored="true" />
<field name="NEWS" type="string" indexed="true" stored="true" />
<field name="LINK" type="string" indexed="true" stored="true" />
...
<fields>