Skip to content

feat(deps): upgrade solr-solrj from 9.9.0 to 10.0.0#58

Open
adityamparikh wants to merge 9 commits intoapache:mainfrom
adityamparikh:solrj-10
Open

feat(deps): upgrade solr-solrj from 9.9.0 to 10.0.0#58
adityamparikh wants to merge 9 commits intoapache:mainfrom
adityamparikh:solrj-10

Conversation

@adityamparikh
Copy link
Contributor

@adityamparikh adityamparikh commented Mar 6, 2026

Depends on: #59 (Solr 10 compat) ← #55 (JSON wire format)

Summary

Upgrades solr-solrj from 9.9.0 → 10.0.0, taking advantage of the JSON wire format (#55) and Solr 10 compatibility (#59) already in place.

  • Bumps solr version in libs.versions.toml to 10.0.0
  • Removes Jetty BOM alignment (SolrJ 10 uses Jetty 12 internally)
  • Removes Apache HttpComponents exclusion (SolrJ 10 no longer uses it)
  • Replaces Http2SolrClient with HttpJdkSolrClient (new JDK-native HTTP client)
  • Moves SolrQuery import: solrjsolrj.request package
  • Moves ResponseParser import: solrjsolrj.response package
  • Adapts JsonResponseParser: getContentType()getContentTypes() returning Collection<String>; removes processResponse(Reader) (no longer abstract)
  • Fixes CoreAdminResponse.getCoreStatus(): now returns Map<String, SingleCoreData> instead of NamedList

PR chain

  1. feat(config): switch Solr wire format from JavaBin to JSON #55feat/json-wire-formatmain (JSON wire format)
  2. feat(compat): add Solr 10 support with /admin/metrics migration #59solr-10main (Solr 10 compat, built on feat(config): switch Solr wire format from JavaBin to JSON #55)
  3. feat(deps): upgrade solr-solrj from 9.9.0 to 10.0.0 #58solrj-10main (this PR: SolrJ 10 upgrade, built on feat(compat): add Solr 10 support with /admin/metrics migration #59)

Merge in order. After #59 merges, this PR will show only the 1 SolrJ upgrade commit.

Test plan

  • ./gradlew build passes
  • All unit tests pass
  • Testcontainers integration tests pass (real Solr via Docker)
  • Spotless formatting checks pass

🤖 Generated with Claude Code

adityamparikh and others added 2 commits February 28, 2026 23:38
Replace the default BinaryResponseParser (wt=javabin) with a custom
JsonResponseParser (wt=json) for future-proofing and improved
debuggability.

The JsonResponseParser converts Solr's JSON response envelope into the
NamedList<Object> tree that SolrJ typed response classes expect:
- JSON objects → SimpleOrderedMap (extends NamedList, implements Map,
  satisfying both QueryResponse's NamedList casts and SchemaResponse's
  Map cast)
- JSON objects with numFound+docs → SolrDocumentList
- Flat alternating arrays [String, non-String, ...] → SimpleOrderedMap
  (Solr's json.nl=flat encoding for facet counts)
- All other arrays → List
- Decimal numbers → Float (matching JavaBin's float type, required by
  SchemaResponse's (Float) version cast)
- Small integers → Integer, large integers → Long

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: adityamparikh <aditya.m.parikh@gmail.com>
Extract JsonResponseParser instantiation into a dedicated @bean method
so it can be injected as a dependency into solrClient(), making the
wiring explicit and enabling overriding in tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: adityamparikh <aditya.m.parikh@gmail.com>
@adityamparikh adityamparikh marked this pull request as draft March 6, 2026 14:55
adityamparikh and others added 5 commits March 6, 2026 19:27
Replace the static new ObjectMapper() with Spring's auto-configured
ObjectMapper bean injected via constructor. Use MediaType.APPLICATION_JSON_VALUE
for the content type constant instead of a raw string literal.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: adityamparikh <aditya.m.parikh@gmail.com>
…'s ObjectMapper

Extract URL normalization tests from SolrConfigTest into a dedicated
SolrConfigUrlNormalizationTest annotated with @jsontest, so Spring's
auto-configured ObjectMapper is injected rather than using new ObjectMapper().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: adityamparikh <aditya.m.parikh@gmail.com>
… Solr 10

SolrInfoMBeanHandler (and thus the /admin/mbeans endpoint) was removed in
Solr 10. When getCacheMetrics() or getHandlerMetrics() call this endpoint on
a Solr 10 server, SolrJ throws RemoteSolrException (a RuntimeException) because
the server returns an HTML 404 page instead of JSON.

Widen the catch in both methods to include RuntimeException so the server
degrades gracefully (returning null for cache/handler stats) rather than
propagating the exception. The integration tests already handle null stats,
so all tests now pass with solr:10-slim.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: adityamparikh <aditya.m.parikh@gmail.com>
Add Solr 9.10 and 10 to the CI compatibility matrix, running integration
tests against all supported versions (8.11, 9.4, 9.9, 9.10, 10) on every
PR and push to main.

Also update AGENTS.md to document Solr 10 compatibility status: the
/admin/mbeans endpoint removal is handled gracefully, and all other
functionality is verified working with solr:10-slim.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: adityamparikh <aditya.m.parikh@gmail.com>
- Bump solr version to 10.0.0 in libs.versions.toml
- Remove Jetty BOM alignment (Solr 10 uses Jetty 12; no longer needed)
- Remove Apache HttpComponents exclusion (SolrJ 10 no longer uses it)
- Replace Http2SolrClient with HttpJdkSolrClient (new JDK HTTP client)
- Move SolrQuery import: solrj → solrj.request package
- Move ResponseParser import: solrj → solrj.response package
- Adapt ResponseParser: getContentType() → getContentTypes() returning
  Collection<String>; remove processResponse(Reader) (no longer abstract)
- Fix CoreAdminResponse.getCoreStatus(): now returns Map<String,
  SingleCoreData> instead of NamedList — update listCollections()
  and CollectionServiceTest accordingly

All unit and Testcontainers integration tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: adityamparikh <aditya.m.parikh@gmail.com>
adityamparikh added a commit to adityamparikh/solr-mcp that referenced this pull request Mar 8, 2026
…o sb4

Incorporates:
- feat(config): switch Solr wire format from JavaBin to JSON (apache#55)
- fix(collection): catch RuntimeException from removed /admin/mbeans in Solr 10 (apache#59)
- feat(ci): add Solr 9.10 and 10 compatibility testing (apache#59)
- feat(deps): upgrade solr-solrj from 9.9.0 to 10.0.0 (apache#58)

Adapted JsonResponseParser for Jackson 3 (tools.jackson.databind).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: adityamparikh <aditya.m.parikh@gmail.com>
@adityamparikh adityamparikh marked this pull request as ready for review March 8, 2026 21:26
adityamparikh and others added 2 commits March 8, 2026 20:09
- S1488: return stream expression directly in validateCollectionExists
  instead of assigning to local variable
- S7467: replace unused caught exceptions with _ (Java 25 unnamed
  variables) in CollectionService and SolrConfigUrlNormalizationTest

Signed-off-by: Aditya Parikh <aditya.m.parikh@gmail.com>

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: adityamparikh <aditya.m.parikh@gmail.com>
Merged upstream observability (OpenTelemetry/LGTM) and docs fixes.
Kept branch-specific SolrJ 10 compatibility changes in CollectionService.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Aditya Parikh <adityamparikh@apache.org>
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