[ https://issues.apache.org/jira/browse/SOLR-5423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steve Rowe updated SOLR-5423: ----------------------------- Attachment: SOLR-5423.patch Hi Arun, When you post patches, you don't need to remove older versions - in fact, you shouldn't - JIRA will gray out older same-named files, and people can see the evolution of proposed changes. You can see that with the patch file I'm attaching now - your most recent one and mine are both there. If you hover your mouse pointer over an attachment file name, you can see some metadata about it in the tooltip: who posted it and when. In looking at your patch, I noticed that your solution of appending fields by getting their names from the corresponding transformers would put fields in the wrong order if a function pseudofield is not last in the requested fields list. I reordered the requested fields in one of your tests to illustrate this problem. Hoss's and my comments about the get-all-fields-from-the-docs loop already having access to all fields was wrong, because the transformation logic happens later, at the end of {{CSVResponseWriter.writeResponse()}}, in the call to {{TextResponseWriter.writeDocuments()}}. Even if we had been right, appending fields in an order different from the requested order would have been wrong. So the field ordering problem has to be fixed based on the actual requested fields list. The attached patch handles this in {{SolrReturnFields}}, where the requested fields list is parsed, by putting function pseudofields into the (ordered) requested field names - at present, the only consumer of this is {{CSVWriter.writeResponse()}}. This solution doesn't need to change {{CSVResponseWriter}} itself at all. I also added a test to {{ReturnFieldsTest}}. I think this is ready to go. > 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, 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: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org