lemons
lemons

Reputation: 121

update index in Solr, error: required field in SolrSchema not found in DataConfig

I'm trying to update my index, but I keep on getting the error:

org.apache.solr.handler.dataimport.DataImporter verifyWithSchema INFO: UPC is a required field in SolrSchema . But not found in DataConfigfound in DataConfig

I can't figure out why it's complainting, since:

  1. the first time I ran the import, it worked fine, and the only thing I changed was add a few fields (columns) to schema.xml
  2. the table I am querying indeed has a UPC column. Here is what my data-config.xml looks like:

    <dataConfig>
      <dataSource type="JdbcDataSource" 
          driver="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:3306/product" 
          user="root" 
          password="some_password"/>
      <document>
        <entity name="product" 
           query="select * from productdetails">
        </entity>
      </document>
     </dataConfig>
    

But again, the interesting part is that the import worked a second ago, but fails on re-import. I'm hoping somebody has had this problem before. If not, maybe someone can suggest other things to check for?

Upvotes: 1

Views: 2352

Answers (1)

Sven Almgren
Sven Almgren

Reputation: 193

The reason for this is that when DataImportHandler starts it checks its config against your loaded schema. It is not an error, merely a warning. To remove it you have to add a specific field in your import config with a name that matches your required field.

This is not the cause of your failed reimport as this is simply a warning.

Upvotes: 2

Related Questions