DarkLeafyGreen
DarkLeafyGreen

Reputation: 70466

Solr error, unknown field

I just started using Solr php client. First I defined a schema for my data that I want to add to the index

<?xml version="1.0" encoding="UTF-8" ?>
<schema name="qullet" version="1.2">
    <fields>
        <field name="id" type="string" indexed="true" 
                   stored="true" required="true"/>
        <field name="title" type="string" indexed="true"
                   stored="true" required="true"/>
        <field name="description" type="text" indexed="true"
                   stored="true" required="true"/>
        <field name="test" type="text" indexed="true"
                   stored="true" required="true"/>
    </fields>
    <uniqueKey>id</uniqueKey>
</schema>

Adding data to the index gives me the following error

"400" Status: ERRORunknown_field_test

If I remove the field test everything works fine.

Upvotes: 1

Views: 2308

Answers (1)

Mauricio Scheffer
Mauricio Scheffer

Reputation: 99750

You're missing the <fieldType>s. See the sample schema.xml for reference.

Upvotes: 2

Related Questions