Tim-Brooks opened a new pull request, #15886: URL: https://github.com/apache/lucene/pull/15886
When indexing, every field in every document has its schema built via updateDocFieldSchema and validated via assertSameSchema against the existing FieldInfo. For the common case where a field consistently uses the same frozen FieldType instance, this work is redundant — a frozen type is immutable, so its schema contribution is identical every time. This change caches the frozen FieldType on each PerField and checks same object instance to detect when the type hasn't changed. When it matches, schema building and validation are skipped entirely, and FieldSchema only resets its docID. If a different type is encountered, the cache is invalidated and the full validation path runs. A deoptimize path handles multi-valued fields where a later value uses a different type than earlier values within the same document. Adds FieldType.isFrozen() to support the optimization, and new tests covering the fast-path, cache invalidation, deoptimize, cross-segment validation, and document blocks. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
