Documentation > Errors in Solr > Cannot Change DocValues Type

If Solr is throwing the following error:

java.lang.IllegalArgumentException: cannot change DocValues type from <type> to <other_type> for field <fieldName>

The Solr Schema explains DocValues in this way:

DocValues is recommended (required, if you are using *Point fields) for faceting, grouping, sorting and function queries. DocValues will make the index faster to load, more NRT-friendly and more memory-efficient. [DocValues are] currently only supported by StrField, UUIDField, all *PointFields, and depending on the field type, they might require the field to be single-valued, be required or have a default value.

DocValues is set in many schema fields similar to this one:

<field name="date" type="pdate" docValues="true" indexed="true" stored="true" multiValued="false" /> 
The DocValues type is determined internally by Solr in the following way:

DocValues are only available for specific field types. The types chosen determine the underlying Lucene docValue type that will be used. The available Solr field types are:

StrField and UUIDField.

If the field is single-valued (i.e., multi-valued is false), Lucene will use the SORTED type.
If the field is multi-valued, Lucene will use the SORTED_SET type.
Any Trie* numeric fields, date fields and EnumField.
If the field is single-valued (i.e., multi-valued is false), Lucene will use the NUMERIC type.
If the field is multi-valued, Lucene will use the SORTED_SET type.
Boolean fields
Int|Long|Float|Double|Date PointField
If the field is single-valued (i.e., multi-valued is false), Lucene will use the NUMERIC type.
If the field is multi-valued, Lucene will use the SORTED_NUMERIC type.
From the above, you can see that Solr’s complaint that it “cannot change a DocValues type” implies that someone has changed the definition of the named field, probably by altering the DocValues setting or by changing the multivalue setting.

Possible Solutions:

A field change requires you to reset your index (remove all index data) from your Opensolr Index Control Panel and Re-index the data. Otherwise, the conflict between schema and index will cause many downstream error messages.

If that fails, try creating a new index, and Re-index the data in the new index. (This requires setting up your Drupal Server connection information).





Review us on Google Business
Close Check out the Fully Automated Solr server setup for Drupal & WordPress.