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_1was 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.xmlormanaged-schema). - Check the
termVectors,storeOffsetsWithPositions, andindexOptionsfor 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:
- Update schema/field type as needed
- Reload Solr core/collection
- Wipe the index (delete all docs)
- 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=trueautomatically. 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.

