Skip to content

SOLR-8003: A glob followed by a raw value transformer now writes each matching field raw - #5140

Draft
nick-boss-tech wants to merge 7 commits into
apache:mainfrom
nick-boss-tech:solr-8003-submit
Draft

nick-boss-tech wants to merge 7 commits into
apache:mainfrom
nick-boss-tech:solr-8003-submit

Conversation

@nick-boss-tech

@nick-boss-tech nick-boss-tech commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖 (posted on behalf of Nick Shanin)

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

What happens today

A glob cannot take a raw value transformer, so fl=*_json:[json] returns a 400 error.

A request such as fl=*_json:[json] or fl=su*:[json] is rejected with a 400. The *_json form fails with a "fieldname parse error"; the su* form fails with an "undefined field" error naming su, the text before the *. The parser accepts a glob only when a space, a comma or the end of the string follows it (SolrReturnFields.java lines 307-316 at the merge-base). It then gives up on the glob (lines 332-333 at the merge-base). Today a raw transformer works only on one named field, so writing every _json field raw means listing each name.

What this change does

A glob followed by a raw value transformer now writes each matching field raw.

Proof

A new test fails on the base code and passes with this change.

  • TestRawTransformer.testGlobJsonTransformer (test lines 350-408) sends fl=id,su*:[json],link?:[json] and checks the raw output. It then sends fl=au*:[xml], which is not applied to a JSON response, and fl=su*:[docid], which returns a 400. On the base code the first request is rejected with a 400, so the test fails there.
  • TestRawTransformer.testSuffixGlobJsonTransformer (test lines 411-454) sends fl=id,*_json:[json], the form used as the example above, parses the response, and checks that each returned document writes its payload_json field raw. It then sends fl=*:[json] and checks that the request is rejected with a 400. On the base code the *_json request is rejected with a 400, "Error parsing fieldname: Expected identifier at pos 0 str='*_json:[json]'", so this test fails there.
  • Verified 2026-10-15 at head 85a8d32: TestRawTransformer 4 of 4. With the production file reverted to the previous head 17a5305, the class runs 4 tests with exactly one failure, the suffix-glob test, because the bare-star request is accepted there. On the base code the two glob tests fail, as the earlier verification at 17a5305 recorded.

Limits

Only the JSON writer is tested with a glob. Some combinations are not covered.

  • Every glob request in the test uses wt=json. The XML writer is not tested with a glob.
  • A glob combined with renameFields, and nested child documents, are not tested.

Changelog: changelog/unreleased/SOLR-8003-fl-glob-raw-transformer.yml

AI assistance

AI agents assisted with research, implementation, review, and drafting. 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