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.
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.
tcngramm_X3b_cn_field_content_title_1
was defined/indexed with:indexOptions=DOCS_AND_FREQS_AND_POSITIONS
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!”
schema.xml
or managed-schema
).termVectors
, storeOffsetsWithPositions
, and indexOptions
for this field.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"/>
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
storeOffsetsWithPositions=true
automatically. Check those module settings!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 |
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.
Contact Us about your issue and we’ll look deeper into it.