[ 
https://issues.apache.org/jira/browse/SOLR-5423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13900808#comment-13900808
 ] 

Steve Rowe commented on SOLR-5423:
----------------------------------

Hi Arun,

1. About  {{getOriginalNameForFunctionField()}} - Hoss wrote:

bq.  if the problem is just that ValueSourceAugmenter's "getName" doesn't match 
the actual fieldname the transformer puts in the modified documents, we should 
fix that in ValueSourceAugmenter

and then you wrote:

bq. We can't change this method directly as it has been referred in few other 
places in the code, it may break other places.

That's not a problem, you can fix them in those other places.

2. About instanceof - Hoss wrote:

bq. in general, the amount of instanceof checking going on in your patch seems 
really brittle, and i'm not exactly sure why it's neccessary. As I understand 
it the CSVResponseWriter already loops over all of the field names in the 
documents to be returned to get the list of column names it should output – so 
as long as the transformer logic is applied before that, then won't the field 
names be picked up automatically?

If you look at the loop Hoss describes, where {{fields}} are pulled from the 
response documents (starting at line #244 in your patched version of 
{{CSVResponseWriter.java}}), you shouldn't need to do any of the transformer 
interrogation you're doing at all.  Maybe the condition around the loop needs 
to be expanded to include cases when there are function fields 
({{returnFields.getTransformer() != null}} or something like that)?

3. Unit tests: you added one case, but I'd suggest you add a few more, e.g. the 
one in this issue's description, where there is no field renaming.


> CSV output doesn't include function field
> -----------------------------------------
>
>                 Key: SOLR-5423
>                 URL: https://issues.apache.org/jira/browse/SOLR-5423
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.4
>            Reporter: James Wilson
>         Attachments: SOLR-5423.patch
>
>
> Given a schema with 
>    <field name="price"  type="float" indexed="true" stored="true"/>
>    <field name='numpages' type='int' indexed='true' stored='true'/>
>   
> the following query returns no rows:
> http://localhost:8983/solr/collection1/select?q=*%3A*&rows=30&fl=div(price%2Cnumpages)&wt=csv&indent=true
> However, setting wt=json or wt=xml, it works.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

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

Reply via email to