Documentation > Errors in Solr > Cannot change field from DOCS_AND_FREQS_AND_POSITIONS DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS

Solr Schema Error: Index Options Change Detected

Absolutely classic Solr blunder! This one comes up often when people get a little too creative with their schema changes. Let’s break it down, old-school style.


What’s Happening Here?

You’re seeing this error:

cannot change field “tcngramm_X3b_cn_field_content_title_1” from index options=DOCS_AND_FREQS_AND_POSITIONS to inconsistent index options=DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS

This is a Solr schema error. In short, Solr stores index “options” for fields—how much information (positions, offsets, etc.) is tracked for each field. Once a field is indexed with a certain setting, you can’t later try to index with different options without reindexing or fixing the schema.


Why Did This Happen?

  • At some point, your field tcngramm_X3b_cn_field_content_title_1 was defined/indexed with:
  • indexOptions=DOCS_AND_FREQS_AND_POSITIONS
  • Now, you (or Drupal, or the module, or something) are trying to index it with:
  • indexOptions=DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS

Solr sees this and says:

“You can’t change a field’s index options on the fly! Not in my house!”


How To Fix (Traditional & Proven Methods)

1. Check Your Schema

  • Look at how the field is defined in your Solr schema (schema.xml or managed-schema).
  • Check the termVectors, storeOffsetsWithPositions, and indexOptions for this field.

2. Consistency is Key

  • If you need “offsets” now (maybe for highlighting or advanced features), make sure the field definition is consistent.
  • Either:
  • Update the schema definition and reindex everything
  • Or revert your application/config to use the old index options

Example:
If you’re using storeOffsetsWithPositions="true", you need:

<field name="tcngramm_X3b_cn_field_content_title_1" type="text_general" indexed="true" stored="true" storeOffsetsWithPositions="true"/>

3. Full Reindex Required

Solr doesn’t retroactively change old docs. After changing the schema, delete and reindex all docs for this core/collection.

Traditional steps: 1. Update schema/field type as needed 2. Reload Solr core/collection 3. Wipe the index (delete all docs) 4. Reindex from Drupal/Search API

4. Double-Check Drupal Search API Solr Settings

  • If you’re using field types or options like “highlighting”, it might set storeOffsetsWithPositions=true automatically. Check those module settings!

Summary Table (For the Busy Solr Admin):

Step What to do
1. Check field definition In Solr, ensure index options are consistent
2. Update as needed Change to add offsets if required
3. Reload schema Reload Solr core/collection
4. Wipe & reindex Delete all docs and reindex
5. Check Drupal configs Make sure module options match Solr setup

The Classic Gotcha:

Once a field’s been indexed a certain way, all documents forever after must use the same index options (unless you reindex everything after changing the schema). It’s like family traditions—break one, and there’s chaos at Thanksgiving.


Still stuck?

Contact Us about your issue and we’ll look deeper into it.







Review us on Google Business
ISO-9001 CERTIFIED ISO-27001 CERTIFIED