[
https://issues.apache.org/jira/browse/SOLR-8902?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Steve Rowe updated SOLR-8902:
-----------------------------
Attachment: SOLR-8902-branch_6_0.patch
Attached patch (branch_6_0 only) switches
{{ReturnFieldsTest.testTransformers()}} to use the (test-only) {{\[custom]}}
transformer from {{TestCustomDocTransformer}} instead of the {{\[geo]}}
transformer. Like {{GeoTransformerFactory}}, {{CustomTransformerFactory}}
overrides {{DocTransformer.getExtraRequestFields()}} to request Lucene fields
that won't be (directly) returned in the response.
I reverted the non-test changes introduced in this issue on branch_6_0, and
with this patch, the assertion on line 272 fails properly:
{code:java|title=ReturnFieldsTest.testTransformers()}
268: // Don't return 'text' just because it is required by the transformer
269: rf = new SolrReturnFields( req("fl", "[custom extra=text]") );
270: assertFalse( rf.wantsScore() );
271: assertTrue(rf.wantsField("[custom]"));
272: assertFalse( rf.wantsField( "text" ) );
{code}
Committing to branch_6_0 shortly.
> ReturnFields can return fields that were not requested
> ------------------------------------------------------
>
> Key: SOLR-8902
> URL: https://issues.apache.org/jira/browse/SOLR-8902
> Project: Solr
> Issue Type: Bug
> Components: Response Writers
> Reporter: Ryan McKinley
> Assignee: Ryan McKinley
> Priority: Minor
> Fix For: 6.0.1, 6.1, master (7.0)
>
> Attachments: SOLR-8902-branch_6_0.patch, SOLR-8902.diff
>
>
> It looks like something changed that now returns all fields requested from
> lucene, not just the ones request from solr.
> This is the difference between 'fields' and 'okFieldNames' in
> SolrReturnFields.
> The logic here:
> https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java#L141
> adds all the 'fields' to 'okFieldName'
> I think that should be removed
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]