Joe Walsh
Joe Walsh

Reputation: 210

Solr CSVResponseWriter set csv.mv.escape to none

The CSV writing parameter for Solr csv.mv.escape defaults to \. I don't want the multi-valued fields to be escaped but can't find a way of doing it.

http://localhost:8983/solr/default/select?
q=*:*
&wt=csv
&csv.header=true
&csv.mv.escape=\

To remove the default escaping I'm wanting to be able to do something like this

http://localhost:8983/solr/default/select?
q=*:*
&wt=csv
&csv.header=true
&csv.mv.escape=none

How can this be achieved?

Upvotes: 0

Views: 109

Answers (2)

A P
A P

Reputation: 457

not sure why, but &csv.mv.separator=| works for me

Upvotes: 0

MatsLindh
MatsLindh

Reputation: 52892

As far as I can see in the source, the escape value is set when the CSVStrategy is created, and then only set to a different value if a different value is provided. So I don't think there's a way to make Solr skip the escape.

CSVStrategy mvStrategy = new CSVStrategy(strategy.getDelimiter(), CSVStrategy.ENCAPSULATOR_DISABLED, 
    CSVStrategy.COMMENTS_DISABLED, '\\', false, false, false, false, "\n");

My only, bad, hackish suggestion is, if this only for one time task, to use a value that doesn't occur in the text as the escape value, then replace that value after retrieving the CSV structure.

Upvotes: 1

Related Questions