You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "Mike L." <ja...@yahoo.com> on 2013/09/25 18:32:19 UTC

Solr 4.4 Import from CSV to Multi-value field - Adds quote on last value

 
Solr Family,
 
        I'm a Solr 3.6 user who just pulled down 4.4 yesterday and noticed something a bit odd when importing into a multi-valued field. I wouldn't be surprised if there's a user-error on my end but hopefully there isn't a bug. Here's the situation.
 
I created some test data to import and one field needs to be split into a multi-valued field. This data resides within a .csv file and is structured like the following: 
 
(below are replacement field names. Also note - there are no quotes " within the data.)
 
field1|field2|field3|field4_valueA,field4_valueB,field4_valueC
 http://[myserver]/solr/[my corename]/update?commit=true&separator=|&escape=\&stream.file=[location of file]&fieldnames=field1,field2,field3,field4&optimize=true&stream.contentType=application/csv&f.field4.split=true&f.field4.separator=%2C
 
After importing the data, I see similiar results as the below for the multi-valued field , field4: 
 
<arr name="field4">
<str>field4_valueA</str>
<str>field4_valueB</str>
<str>field4_valueC"</str>  (Why is there a trailing quote here?) 
</arr>
 
I also noticed if only 1 value is being inserted into this multivalued field - there is no issue. It always happens on the last value.
 
Thanks in advance,
Cheers!
Mike

Re: Solr 4.4 Import from CSV to Multi-value field - Adds quote on last value

Posted by "Mike L." <ja...@yahoo.com>.
 
Nevermind, I figured it out. Excel was applying a hidden quote on the data. Thanks anyway.

From: Mike L. <ja...@yahoo.com>
To: "solr-user@lucene.apache.org" <so...@lucene.apache.org> 
Sent: Wednesday, September 25, 2013 11:32 AM
Subject: Solr 4.4 Import from CSV to Multi-value field - Adds quote on last value


 
Solr Family,
 
        I'm a Solr 3.6 user who just pulled down 4.4 yesterday and noticed something a bit odd when importing into a multi-valued field. I wouldn't be surprised if there's a user-error on my end but hopefully there isn't a bug. Here's the situation.
 
I created some test data to import and one field needs to be split into a multi-valued field. This data resides within a .csv file and is structured like the following: 
 
(below are replacement field names. Also note - there are no quotes " within the data.)
 
field1|field2|field3|field4_valueA,field4_valueB,field4_valueC
 http://[myserver]/solr/[my corename]/update?commit=true&separator=|&escape=\&stream.file=[location of file]&fieldnames=field1,field2,field3,field4&optimize=true&stream.contentType=application/csv&f.field4.split=true&f.field4.separator=%2C
 
After importing the data, I see similiar results as the below for the multi-valued field , field4: 
 
<arr name="field4">
<str>field4_valueA</str>
<str>field4_valueB</str>
<str>field4_valueC"</str>  (Why is there a trailing quote here?) 
</arr>
 
I also noticed if only 1 value is being inserted into this multivalued field - there is no issue. It always happens on the last value.
 
Thanks in advance,
Cheers!
Mike