← Back to Pull requests

SOLR-18612: solr/core: SimpleOrderedMap for search-side response sections #5365

Open
unknown opened this pull request with 580 lines diff across 7 files
View on GitHub
unknown unknown commented on Nov 19, 2026 07:52 UTC
Author

https://issues.apache.org/jira/browse/SOLR-18612

Description

SIP-22 step 5, fourth slice (after #5311 SolrJ, #5326 core init args, #5336 admin/backup responses). This one covers the search-side solr/core sites where a NamedList is built with keys that never repeat: 22 sites in 14 Java files, plus the one Admin UI screen that read one of them in the flat form.

Independent of #5336 (no shared files except the upgrade-note page: both add a "Response Format" section with their own bullets, so whichever merges second gets a one-line merge of the bullet lists).

Solution

Response-visible, each keyed by something unique (term, document key, field name, fixed names):

  • LukeRequestHandler: a field's histogram (topTerms stays a NamedList: indexedToReadable() is not injective for legacy Trie precision terms, so readable keys can repeat)

  • MoreLikeThisHandler: interestingTerms with mlt.interestingTerms=details

  • MoreLikeThisComponent: the SolrCloud moreLikeThis section, keyed by document, as single-node already was

  • SearchHandler: the debug/explain section emitted for an empty result

  • IGainTermsQParserPlugin (featuredTerms; docFreq stays a NamedList because the producer adds each featured term a second time with a null value, a pre-existing bug worth its own JIRA), TextLogisticRegressionQParserPlugin (logit)

  • DirectUpdateHandler2.split: the Core Admin SPLIT response (timing, failed)
  • Internal, never serialized as is: the spellchecker and JSON-facet config conversions (SpellCheckComponent, FacetParser), SignificantTermsQParserPlugin's working maps, the managed-resource initArgs (ManagedResource/RestManager; the response already converts it to a map), and the grouping shard-result serializers (SearchGroupsResultTransformer, TopGroupsResultTransformer), whose output travels between shards as javabin and is read back as a NamedList either way.

    Admin UI: the Schema Browser's term-info panel parsed Luke's topTerms and histogram by index as a flat [name, value, ...] array, so it rendered nothing once they became objects (this is what broke the Admin UI tests on an earlier, larger version of this change). schema.js now reads both forms through one helper and sorts object-form topTerms by descending count before grouping, since JavaScript enumerates integer-like keys first. The upgrade note says so.

    AI disclosure: the site classification, the edits, the notes and this description were drafted with Claude Code and reviewed by me.

    Tests

    No new Java tests: the shape change is the documented intent of this SIP step. Ran the suites covering every changed path: LukeRequestHandlerTest, LukeRequestHandlerDistribTest, MoreLikeThisHandlerTest, MoreLikeThisComponentTest, DistributedMLTComponentTest, DebugComponentTest, DistributedDebugComponentTest, SpellCheckComponentTest, DistributedSpellCheckComponentTest, SignificantTermsQParserPluginTest, TestDistributedGrouping, SolrIndexSplitterTest, SplitByPrefixTest, the rest package and TestJsonFacets: 175 tests, all pass. Plus ./gradlew check -x test.

    Coverage gaps, stated plainly: {!igain} and {!tlogit} have no functional tests in solr/core (they are driven by the streaming features/train expressions). The Admin UI browser tests (:solr:webapp:test -Ptests.selenium=true) could not run on my machine because Selenium Manager does not support Linux ARM; the rewritten schema.js parser was checked under Node with both input forms and produces identical structures, and the "Admin UI Tests" workflow should be allowed to run on this PR.

    Checklist

    Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.

  • 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. (optional but recommended, not available for branches on forks living under an organisation)

  • I have developed this patch against the main branch.

  • I have run ./gradlew check.

  • I have added tests for my changes.

  • I have added documentation for the Reference Guide

  • I have added a changelog entry for my change
  • Diff: 580 lines (+435 / -145) across 7 files Reviewer: nick-boss-tech Review duration: 11630m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.50) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 580 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.381
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #5365"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 49.9% (MEDIUM) · Higher = larger blast radius
    49.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 26.6% · Safe to merge
    26.6%
    Repository