3

私の Solr schema.xml には、整数フィールドと text_general フィールドがあります。

<field name="popularity" type="int" indexed="true" stored="true" />
<field name="priority" type="text_general" indexed="true" stored="true" />

次のデータを Solr にインデックス付けしようとすると、"400" Status: Bad Request が表示されます

    <add>
        <doc>
            <field name="popularity"></field>
            <field name="id">id_001</field>
            <field name="priority">10</field>
        </doc>
    </add>

次のデータにインデックスを付けるとうまく機能しますが:

    <add>
        <doc>
            <field name="popularity">5</field>
            <field name="id">id_002</field>
            <field name="priority"></field>
        </doc>
    </add>

つまり、整数フィールドを空にすることはできませんが、text_general を空にすることはできますか?

SolrPHPClient を使用してデータのインデックスを作成しています。http://code.google.com/p/solr-php-client/

4

2 に答える 2

2

設定したくないフィールドを使用しないことも有効ではないので、次のようにします。

<add>
    <doc>
        <field name="id">id_001</field>
        <field name="priority">10</field>
    </doc>
</add>
于 2012-12-14T03:37:49.493 に答える