serhiy-bzhezytskyy opened a new pull request, #4651: URL: https://github.com/apache/solr/pull/4651
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)"). 1. **Sort "missing value"** (where docs without a value in the sort field are placed). Lucene 11 removes `SortField.setMissingValue(...)`; the value must be passed to the `SortField` constructor instead. `FieldType` and `EnumFieldType` now 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. 2. **Automaton concatenation** in the reverse-wildcard query path. Lucene 11 removes `Operations.concatenate(a, b)` in favor of `Operations.concatenate(List.of(a, b))`. `SolrQueryParserBase` now uses the `List` form. 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 small `missingValue(...)` helper and passed its result into the `SortField` / `SortedSetSortField` / `SortedNumericSortField` constructors (was: construct, then `setMissingValue`). `EnumFieldType.getSortField` rebuilds via the constructor when it needs its `Integer.MIN_VALUE` default. - `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 check` on current main (Lucene 10.4), plus the affected suites: `TestFieldCacheSort`, `TestSort`, `EnumFieldTest`, `TestReversedWildcardFilterFactory`, `SolrIndexConfigTest` — all green. # Checklist - [x] I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability. - [x] I have created a Jira issue and added the issue ID to my pull request title. - [ ] I have given Solr maintainers access to contribute to my PR branch. (branch is on a personal fork) - [x] I have developed this patch against the `main` branch. - [x] I have run `./gradlew check`. - [ ] I have added tests for my changes. (no-behavior-change refactor; covered by existing tests) - [ ] I have added documentation for the Reference Guide. (n/a — no user-facing change) - [x] I have added a changelog entry for my change. -- 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]
