Prometheus
Prometheus

Reputation: 639

Solr : Ignore rows not having required field while indexing using CSV

I want to perform indexing in Solr using CSV file. Solr throws an error if there is even a single row having empty required field, it stops whole indexing, as result I get no row indexed. I want to know how do I ignore such rows without required fields and perform indexing on only rows having required fields. Following is the entry for column in schema.xml :

<field name="XXXX" type="string" indexed="true" stored="true" required="true" multiValued="false" />

Thank you in advance.

Upvotes: 0

Views: 581

Answers (1)

Alexandre Rafalovitch
Alexandre Rafalovitch

Reputation: 9789

You have a couple of options:

  1. You can provide default value for the field in the schema definition
  2. You can provide default value for the field in the custom update request processor chain (DefaultValueUpdateProcessorFactory)
  3. With Solr 6.1, you can ignore the record that's causing an error, also in the custom URP chain (TolerantUpdateProcessorFactory)

Upvotes: 2

Related Questions