Skip to content

SOLR-18608: Honor glob field selection in real-time get and lazy document prefetch - #5298

Draft
nick-boss-tech wants to merge 4 commits into
apache:mainfrom
nick-boss-tech:pr-5188-glob-field-loading-followup
Draft

nick-boss-tech wants to merge 4 commits into
apache:mainfrom
nick-boss-tech:pr-5188-glob-field-loading-followup

Conversation

@nick-boss-tech

@nick-boss-tech nick-boss-tech commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖 (reviewed by Nick Shanin)

Draft status is due to Nick Shanin's open-PR cap; the change is complete and ready for review.

Jira: SOLR-18608. Follow-up to SOLR-11364 / PR 5188, now merged.

What happens today

Partial field globs can load unrelated stored values in real-time get and skip lazy prefetch in search.

An index-backed /get with fl=title,other_* falls back to loading all stored fields. A /select with fl=source_* skips prefetch, including the stored-field combination needed for highlighting.

What this change does

Share stored-field selection while preserving the DocValues-only search path.

RTG uses the shared selector for matching stored fields and transformer inputs, then filters cached fields before conversion. Glob prefetch applies the response optimizer's DocValues substitution, adds highlight fields and the unique key, and skips an empty stored set. Explicit-field prefetch and the shard/50-result guards retain their previous behavior.

Proof

Linux tests and checks pass at the current head.

Linux verification at a99e402

Verified 2026-11-05 with JDK 21, Gradle 9.7.0 and seed 5298C0DE:

  • BasicFunctionalityTest: 31 passed.
  • TestPseudoReturnFields: 35 passed.
  • TestUnifiedSolrHighlighter: 33 passed.
  • ReturnFieldsTest: 16 passed.
  • TestRetrieveFieldsOptimizer: 1 passed.
  • LargeFieldTest: 1 passed.

The six suites total 117 tests with no failures, errors or skips. Nine focused methods and an independent LargeFieldTest run also passed. Root tidy, Error Prone compilation and root check -x test passed; formatting left the tested head unchanged.

With the final tests overlaid on 7ee68a7000, testGlobNonStoredDocValuesPrefetch, testGlobSubstitutedDocValuesPrefetch and testGlobEmptyPrefetch each fail at the intended Unexpected stored-document prefetch assertion. All pass at this head.

Test results and root tidy result.

Limits

The change covers stored-field loading and prefetch.

RTG DocValues decoration and term-vector selection are unchanged. No full core test suite, repository-wide test run, disk-I/O measurement or latency benchmark was performed. Lazy-wrapper assertions do not establish which backing values Lucene reads on cache hits.

Changelog: SOLR-18608

AI-generated description. Nick Shanin directed the work and takes responsibility for this contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant