[ https://issues.apache.org/jira/browse/SOLR-1925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yonik Seeley updated SOLR-1925: ------------------------------- Attachment: SOLR-1925.patch Here's a patch that produces output that can correctly round-trip with the CSV loader. It uses the current version of commons CSV, including the CSVPrinter overhaul I did in SANDBOX-322 Parameters: csv.encapsulator (defaults to ") csv.escape (defaults to none) csv.separator (defaults to ,) csv.header (defaults to true... if false, we skip printing out the column headers) csv.newline (defaults to \n) csv.null (defaults to "") // csv.mv params are the defaults for how multi-valued fields are encoded // per-field overrides can be done via f.myfield.csv.separator=| csv.mv.encapsulator (defaults to none) csv.mv.escape (defaults to \) csv.mv.separator (defaults to csv.separator) Notes: - works on fields in the index that aren't even defined in the schema - maintains the order of fields passed in by the user (and allows the header to be omitted) - efficiently streamable... avoids intermediate creation of SolrDocument instances, and reuses a single buffer & writer across all instances of multi-valued fields for the sub-CSVPrinters I'll start adding some tests now. > CSV Response Writer > ------------------- > > Key: SOLR-1925 > URL: https://issues.apache.org/jira/browse/SOLR-1925 > Project: Solr > Issue Type: New Feature > Components: Response Writers > Environment: indep. of env. > Reporter: Chris A. Mattmann > Assignee: Erik Hatcher > Fix For: Next > > Attachments: SOLR-1925.Chheng.071410.patch.txt, > SOLR-1925.Mattmann.053010.patch.2.txt, SOLR-1925.Mattmann.053010.patch.3.txt, > SOLR-1925.Mattmann.053010.patch.txt, SOLR-1925.Mattmann.061110.patch.txt, > SOLR-1925.patch > > > As part of some work I'm doing, I put together a CSV Response Writer. It > currently takes all the docs resultant from a query and then outputs their > metadata in simple CSV format. The use of a delimeter is configurable (by > default if there are multiple values for a particular field they are > separated with a | symbol). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org