This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-mcp.git


The following commit(s) were added to refs/heads/main by this push:
     new 9960827  refactor: remove dead fields and unused FieldStats type (#106)
9960827 is described below

commit 9960827162b9f4f3a22458a638c04942277e0962
Author: Aditya Parikh <[email protected]>
AuthorDate: Tue Aug 18 16:58:47 2026 -0400

    refactor: remove dead fields and unused FieldStats type (#106)
    
    Remove always-null `solrVersion` and `status` fields from
    `SolrHealthStatus` record, and remove the unused `FieldStats` record
    along with its native image hint registration. This reduces maintenance
    burden and clarifies the actual data contract.
    
    Signed-off-by: adityamparikh <[email protected]>
    Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
    Co-authored-by: Eric Pugh <[email protected]>
---
 AGENTS.md                                          |  2 +-
 .../mcp/server/collection/CollectionService.java   |  4 +-
 .../apache/solr/mcp/server/collection/Dtos.java    | 51 +---------------------
 .../solr/mcp/server/config/SolrNativeHints.java    |  8 ++--
 4 files changed, 8 insertions(+), 57 deletions(-)

diff --git a/AGENTS.md b/AGENTS.md
index 2fb0248..65b039b 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -211,7 +211,7 @@ buildpacks (`bootBuildImage -Pnative`). Key configuration:
   - **MCP tool response records** (invisible to AOT because the MCP framework 
uses
     generic `Object` dispatch): `CollectionCreationResult`, `SolrHealthStatus`,
     `SolrMetrics`, `IndexStats`, `QueryStats`, `CacheStats`, `CacheInfo`,
-    `HandlerStats`, `HandlerInfo`, `FieldStats`, `SearchResponse`
+    `HandlerStats`, `HandlerInfo`, `SearchResponse`
   - **Resource**: `logback.xml` (see Logging Architecture above)
 - **Wire format:** `SolrConfig` uses `XMLRequestWriter` instead of the default
   `JavaBinRequestWriter`. The JavaBin binary codec uses deep reflection that 
would
diff --git 
a/src/main/java/org/apache/solr/mcp/server/collection/CollectionService.java 
b/src/main/java/org/apache/solr/mcp/server/collection/CollectionService.java
index b034776..978ed87 100644
--- a/src/main/java/org/apache/solr/mcp/server/collection/CollectionService.java
+++ b/src/main/java/org/apache/solr/mcp/server/collection/CollectionService.java
@@ -1069,10 +1069,10 @@ public class CollectionService {
                                        new 
SolrQuery(ALL_DOCUMENTS_QUERY).setRows(0));
 
                        return new SolrHealthStatus(true, null, 
pingResponse.getElapsedTime(),
-                                       
statsResponse.getResults().getNumFound(), Instant.now(), actualCollection, 
null, null);
+                                       
statsResponse.getResults().getNumFound(), Instant.now(), actualCollection);
 
                } catch (Exception e) {
-                       return new SolrHealthStatus(false, e.getMessage(), 
null, null, Instant.now(), actualCollection, null, null);
+                       return new SolrHealthStatus(false, e.getMessage(), 
null, null, Instant.now(), actualCollection);
                }
        }
 
diff --git a/src/main/java/org/apache/solr/mcp/server/collection/Dtos.java 
b/src/main/java/org/apache/solr/mcp/server/collection/Dtos.java
index 7a37799..e5ab3f2 100644
--- a/src/main/java/org/apache/solr/mcp/server/collection/Dtos.java
+++ b/src/main/java/org/apache/solr/mcp/server/collection/Dtos.java
@@ -148,49 +148,6 @@ record IndexStats(
                Integer segmentCount) {
 }
 
-/**
- * Field-level statistics for individual Solr schema fields.
- *
- * <p>
- * Provides detailed information about how individual fields are utilized 
within
- * the Solr index. This information helps with schema optimization and
- * understanding field usage patterns.
- *
- * <p>
- * <strong>Statistics include:</strong>
- *
- * <ul>
- * <li><strong>type</strong>: Solr field type (e.g., "text_general", "int",
- * "date")
- * <li><strong>docs</strong>: Number of documents containing this field
- * <li><strong>distinct</strong>: Number of unique values for this field
- * </ul>
- *
- * <p>
- * <strong>Analysis Insights:</strong>
- *
- * <p>
- * High cardinality fields (high distinct values) may require special indexing
- * considerations, while sparsely populated fields (low docs count) might
- * benefit from different storage strategies.
- *
- * <p>
- * <strong>Note:</strong> This class is currently unused in the collection
- * statistics but is available for future field-level analysis features.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-@JsonInclude(JsonInclude.Include.NON_NULL)
-record FieldStats(
-               /** Solr field type as defined in the schema configuration */
-               String type,
-
-               /** Number of documents in the index that contain this field */
-               Integer docs,
-
-               /** Number of unique/distinct values for this field across all 
documents */
-               Integer distinct) {
-}
-
 /**
  * Query execution performance metrics from Solr search operations.
  *
@@ -467,13 +424,7 @@ record SolrHealthStatus(
                @JsonFormat(shape = JsonFormat.Shape.STRING) Instant 
lastChecked,
 
                /** Name of the collection that was checked */
-               String collection,
-
-               /** Version of Solr server (when available) */
-               String solrVersion,
-
-               /** Additional status information or state description */
-               String status) {
+               String collection) {
 }
 
 /**
diff --git 
a/src/main/java/org/apache/solr/mcp/server/config/SolrNativeHints.java 
b/src/main/java/org/apache/solr/mcp/server/config/SolrNativeHints.java
index f8133bf..2d1cedf 100644
--- a/src/main/java/org/apache/solr/mcp/server/config/SolrNativeHints.java
+++ b/src/main/java/org/apache/solr/mcp/server/config/SolrNativeHints.java
@@ -68,10 +68,10 @@ public class SolrNativeHints {
                        
"org.apache.solr.mcp.server.collection.CollectionCreationResult",
                        
"org.apache.solr.mcp.server.collection.SolrHealthStatus",
                        "org.apache.solr.mcp.server.collection.SolrMetrics", 
"org.apache.solr.mcp.server.collection.IndexStats",
-                       "org.apache.solr.mcp.server.collection.FieldStats", 
"org.apache.solr.mcp.server.collection.QueryStats",
-                       "org.apache.solr.mcp.server.collection.CacheStats", 
"org.apache.solr.mcp.server.collection.CacheInfo",
-                       "org.apache.solr.mcp.server.collection.HandlerStats", 
"org.apache.solr.mcp.server.collection.HandlerInfo",
-                       "org.apache.solr.mcp.server.search.SearchResponse", 
"org.apache.solr.mcp.server.schema.SchemaUpdateResult");
+                       "org.apache.solr.mcp.server.collection.QueryStats", 
"org.apache.solr.mcp.server.collection.CacheStats",
+                       "org.apache.solr.mcp.server.collection.CacheInfo", 
"org.apache.solr.mcp.server.collection.HandlerStats",
+                       "org.apache.solr.mcp.server.collection.HandlerInfo", 
"org.apache.solr.mcp.server.search.SearchResponse",
+                       "org.apache.solr.mcp.server.schema.SchemaUpdateResult");
 
        static class Registrar implements RuntimeHintsRegistrar {
                @Override

Reply via email to