dsmiley opened a new pull request, #5113:
URL: https://github.com/apache/solr/pull/5113

   https://issues.apache.org/jira/browse/SOLR-9957
   
   # Description
   
   `/export` silently ignored document transformers in `fl` (e.g. `[docid]`, 
`[value]`, `[explain]`), and field aliases like `fl=x:myfield` came back under 
the original name. `fl` was also split naively on commas, so transformer local 
params containing commas broke.
   
   # Solution
   
   - Parse `fl` with `SolrReturnFields` (same as `/select`), so transformers, 
their local params, and aliases parse correctly. `score` is still rejected.
   - When `fl` has a transformer, each doc's fields are collected into a 
`SolrDocument`, the transformer is applied with the global docid, and the 
wanted fields are written out. Without a transformer, the existing streaming 
path is unchanged (no per-doc allocation).
   - Transformers get a `ResultContext` with the export's searcher, query and 
request. There is no `DocList`, so transformers needing one (or scores) aren't 
supported; this is documented.
   - Fields a transformer needs (e.g. an alias's source) are fetched even if 
not listed in `fl`.
   - Transformer output flows into tuples seen by the local streaming 
expression (`expr`).
   
   Behavior change: `fl=x:myfield` now returns `x` rather than `myfield`. Noted 
in the changelog.
   
   # Tests
   
   - New `TestExportWriter.testDocTransformers`: `[docid]` matches `/select`'s, 
multi-valued fields survive, aliases and comma-containing local params work, 
transformer output reaches `expr`, and `score` is still rejected.
   - Passing: `org.apache.solr.handler.export.*`, plus `StreamExpressionTest`, 
`StreamingTest`, `StreamDecoratorTest`; `./gradlew check -x test`.
   
   🤖 This PR was written with [Claude Code](https://claude.com/claude-code) 
(AI-generated), directed and reviewed by the author.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to