Commit cb04f63
authored
feat(compat): Solr 10 support with metrics API migration (#61)
Comprehensive Solr 10 compatibility PR that consolidates the metrics API migration,
create-collection tool, CI matrix expansion, and code review hardening into a single
reviewable changeset.
Metrics API migration: getCacheMetrics() and getHandlerMetrics() now use
/admin/metrics (available since Solr 7.1+) instead of the removed /admin/mbeans
Create-collection MCP tool: New create-collection tool with authentication,
configSet/numShards/replicationFactor defaults
CI matrix: Tests now run against Solr 8.11, 9.4, 9.9, 9.10, and 10
Code review fixes:
Fix ClassCastException risk in CollectionUtils.getFloat — added instanceof
check and String fallback parsing
Add extractCollectionName() to checkHealth for shard name support
Populate collection field in SolrHealthStatus response
Eliminate 3 redundant listCollections() round-trips per getCollectionStats call
Return null instead of 0.0f from getFloat for missing values (consistent
with getLong/getInteger)
Integration tests rewritten: Setup indexes 50 documents and runs 15 warm-up
queries (with filter queries) against real Solr via Testcontainers. Tests assert
actual non-zero metric values:
numDocs == 50, totalResults == 50, totalDocuments == 50
queryResultCache.lookups > 0, documentCache.lookups > 0, filterCache.lookups > 0
selectHandler.requests > 0, updateHandler.requests > 0
System.out.println replaced with SLF4J, @BeforeEach/static-boolean replaced
with @BeforeAll/@testinstance(PER_CLASS)1 parent 1b73064 commit cb04f63
5 files changed
Lines changed: 540 additions & 558 deletions
File tree
- src
- main/java/org/apache/solr/mcp/server/collection
- test/java/org/apache/solr/mcp/server/collection
0 commit comments