Skip to content

Add missing Lucene99 codec and relax term vectors constraint whem merging#20

Open
david-sitsky wants to merge 2 commits intohakanai:mainfrom
Nuix:fix-missing-lucene9-codecs-and-relax-term-vectors-constraint
Open

Add missing Lucene99 codec and relax term vectors constraint whem merging#20
david-sitsky wants to merge 2 commits intohakanai:mainfrom
Nuix:fix-missing-lucene9-codecs-and-relax-term-vectors-constraint

Conversation

@david-sitsky
Copy link

It seems in Lucene 8.x and earlier, a field with "term vectors" enabled but with no actual terms emitted, will set "term vectors" to false for that field, but in Lucene 9 it respects the field definition regardless of terms emitted. I relaxed the strictness check introduced in Lucene 9 otherwise some migrations may fail for an index which has multiple segments created in different versions.

David Sitsky added 2 commits February 10, 2026 15:13
Lucene 8 sets "term vectors" to false even if a field was declared to use
"term vectors", but it emitted no terms in the entire segment.

Lucene 9 seems to rely on the declared field.  Disabling this check to
avoid these headaches.
// even if a field was declared to use "term vectors", but it emitted no terms in the entire segment.
// Lucene 9 seems to rely on the declared field. Disabling this check to avoid these headaches.
this.strictlyConsistent = false;
// this.strictlyConsistent = indexCreatedVersionMajor >= 9;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change may not be safe after all.. but the other changes are worth putting in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant