SOLR-18313: Prep for Lucene 11: switch two call sites to the newer Lucene API forms - #4651
Open
serhiy-bzhezytskyy wants to merge 1 commit into
Open
SOLR-18313: Prep for Lucene 11: switch two call sites to the newer Lucene API forms#4651serhiy-bzhezytskyy wants to merge 1 commit into
serhiy-bzhezytskyy wants to merge 1 commit into
Conversation
…cene API forms
Lucene 11 removes two old API forms Solr uses; both have a replacement that already
exists in Lucene 10.4 (what we're on). Switching now is a no-behavior-change cleanup
that shrinks the eventual Lucene 11 upgrade.
1. Sort missing value: Lucene 11 removes SortField.setMissingValue(...); the value must
go to the constructor. FieldType/EnumFieldType now compute the missing value and pass
it into the SortField constructor instead of setting it after construction. Missing
values still sort in the same place.
2. Automaton concatenation: Lucene 11 removes Operations.concatenate(a, b) in favor of
concatenate(List.of(a, b)). SolrQueryParserBase (reverse-wildcard handling) uses the List form.
No functional change, nothing to reindex. Discussed on dev@ ("[EXPERIMENT] Upgrading Solr
against Lucene main (the future 11.0)"). The broader Lucene 11 port and the Java 25 baseline
bump are deferred until Lucene 11 is released.
serhiy-bzhezytskyy
force-pushed
the
lucene11-prep-on-10x
branch
from
July 22, 2026 13:54
6986122 to
e8e3d51
Compare
dsmiley
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/SOLR-18313
Description
Lucene 11 removes two old API forms that Solr currently uses. Both have a replacement that already exists in the Lucene we're on today (10.4), so we can switch now with no behavior change, which shrinks the eventual Lucene 11 upgrade. Discussed on dev@ ("[EXPERIMENT] Upgrading Solr against Lucene main (the future 11.0)").
SortField.setMissingValue(...); the value must be passed to theSortFieldconstructor instead.FieldTypeandEnumFieldTypenow compute the missing value and pass it into the constructor rather than setting it after construction. Missing values sort in the same place as before.Operations.concatenate(a, b)in favor ofOperations.concatenate(List.of(a, b)).SolrQueryParserBasenow uses theListform.No functional change and nothing to reindex. The broader Lucene 11 port and the Java 25 baseline bump are deferred until Lucene 11 is released.
Solution
Replaced the two call sites with the Lucene 10.4 equivalents:
FieldType: extracted the missing-value computation into a smallmissingValue(...)helper and passed its result into theSortField/SortedSetSortField/SortedNumericSortFieldconstructors (was: construct, thensetMissingValue).EnumFieldType.getSortFieldrebuilds via the constructor when it needs itsInteger.MIN_VALUEdefault.SolrQueryParserBase:Operations.concatenate(a, b)→Operations.concatenate(List.of(a, b)).AI assistant disclosure: I used an AI coding assistant to help scope which Lucene 11 changes are already adoptable on 10.4 and to draft this change; I reviewed and verified all of it.
Tests
No new tests — this is a no-behavior-change refactor covered by existing tests. Ran
./gradlew checkon current main (Lucene 10.4), plus the affected suites:TestFieldCacheSort,TestSort,EnumFieldTest,TestReversedWildcardFilterFactory,SolrIndexConfigTest— all green.