0

我正在尝试用修改的字段索引一个 xml 文件,但是 solr 给出的错误是 #400 bad request,读取响应 java.io.IOException 时出现 IO 异常。

这是我的 xml 文件内容。

 <?xml version="1.0" encoding="UTF-8" ?>

    <add>
      <doc>
        <field name="id">1</field>
        <field name="name">Atomic Counters</field>
        <field name="type">Accelerated Parallel Process</field>
        <field name="level">Beginner</field>

        <field name="Discription">If you use the method described above, only the "employee" element can use the specified complex type. Note that the child elements, "firstname" and "lastname", are surrounded by the <sequence> indicator. </field>

        <field name="open_cl">#1.0#1.1#1.2</field>
        <field name="version">1.1</field>
        <field name="date">1995-12-31T23:59:59Z</field>
        <field name="download1_link">http://en.wikipedia.org/wiki/Documentation</field>
        <field name="download2_link">http://en.wikipedia.org/wiki/Documentation</field>


      </doc>
    </add>

同样在此之前,我已经在 solr\example\solr\collection1\conf\schema.xml 文件中添加了几行

   <field name="download_link" type="text_general" indexed="true" stored="true" multiValued="true"/>
   <field name="download2_link" type="text_general" indexed="true" stored="true" multiValued="true"/>

   <field name="version" type="string" indexed="true" stored="true"/>
   <field name="open_cl" type="string" indexed="true" stored="true"/>
   <field name="level" type="string" indexed="true" stored="true"/>   
   <field name="type" type="string" indexed="true" stored="true"/>

还是不行..我是不是错过了什么..

提前致谢。

4

2 回答 2

0

感谢您回复我的询问..

我发现了我的错误..在我提到应该是描述的描述的字段中,download1_link 应该写为download_link,最后我没有在模式文件本身中提到日期的字段类型。在maraswrona指着原木后,我才知道这一点。我去了 solr 管理仪表板并查找日志并清除指出错误。

再次感谢大家...

于 2013-10-11T05:13:09.393 回答
0

在我看来,您的 xml 不是格式正确的文档

您的行包含:

<field name="Discription">If you use ... by the <sequence> indicator. </field>

<sequence>文本应该被转义,如下所示:

<field name="Discription">If you use ... by the &lt;sequence&gt; indicator. </field>
于 2013-10-10T08:50:34.270 回答