Interestingly this URL by Jack works:
1. curl '
http://localhost/solr/prodinfo/update/csv?commit=true&f.merchantList.split=true&f.merchantList.separator=%3A&f.merchantList.encapsulator=%22&stream.contentType=text/csv&stream.file=/tmp/test.csv
'

But this doesn't (i.e. it doesn't split the column):
2. curl '
http://localhost/solr/prodinfo/update/csv?commit=true&f.merchantList.split=true&f.merchantList.separator=%3A&f.merchantList.encapsulator=%22&escape=\&stream.contentType=text/csv&stream.file=/data/dump/catalog.txt
'

The only difference was "&escape=\", I added that in Jack's example and it
didn't work either. So the culprit was "&escape=\", not sure why.


Thanks,
-Utkarsh




On Thu, Oct 10, 2013 at 6:11 PM, Yonik Seeley <ysee...@gmail.com> wrote:

> Perhaps try adding echoParams=all
> to check that all of the input params are being parsed as expected.
>
> -Yonik
>
> On Thu, Oct 10, 2013 at 8:10 PM, Utkarsh Sengar <utkarsh2...@gmail.com>
> wrote:
> > Didn't help.
> >
> > This is the complete data: https://gist.github.com/utkarsh2012/6927649(see
> > merchantList column).
> > I tried this URL:
> > curl '
> >
> http://localhost/solr/coll1/update/csv?commit=true&f.merchantList.split=true&f.merchantList.separator=%3A&f.merchantList.encapsulator=%22&escape=\&stream.contentType=text/csv&stream.file=/data/dump/log_20130101
> > '
> >
> > Can this be a bug in the UpdateCSV split function?
> >
> > Thanks,
> > -Utkarsh
> >
> >
> >
> > On Thu, Oct 10, 2013 at 3:11 PM, Jack Krupansky <j...@basetechnology.com
> >wrote:
> >
> >> Using the standard Solr example for Solr 4.5, the following works,
> >> splitting the features CSV field into multiple values:
> >>
> >> curl "http://localhost:8983/solr/**update/csv?commit=true&f.**
> >> features.split=true&f.**features.separator=%3A&f.**
> >> features.encapsulator=%22<
> http://localhost:8983/solr/update/csv?commit=true&f.features.split=true&f.features.separator=%3A&f.features.encapsulator=%22
> >"
> >> -H "Content-Type: text/csv" -d '
> >> id,name,features
> >> doc-1,doc1,feat1:feat2'
> >>
> >> You may need to add &stream.contentType=text/csv to you command.
> >>
> >> -- Jack Krupansky
> >>
> >> -----Original Message----- From: Utkarsh Sengar
> >> Sent: Thursday, October 10, 2013 4:51 PM
> >> To: solr-user@lucene.apache.org
> >> Subject: Using split in updateCSV for SolrCloud 4.4
> >>
> >>
> >> Hello,
> >>
> >> I am trying to use split: http://wiki.apache.org/solr/**UpdateCSV#split
> <http://wiki.apache.org/solr/UpdateCSV#split>while
> >> loading some csv data via updateCSV.
> >>
> >> This is the field:
> >> <field name="merchantList"  type="string" indexed="true"  stored="true"
> >> multiValued="true" omitNorms="true" termVectors="false"
> >> termPositions="false" termOffsets="false"/>
> >>
> >> This is the column in CSV (merchantList):
> >> ....values....,"16179:10950",.**....values..
> >>
> >>
> >> This is the URL I call:
> >> http://localhost/solr/coll1/**update/csv?commit=true&f.**
> >> merchantList.split=true&f.**merchantList.separator=%3A&f.**
> >> merchantList.encapsulator=<
> http://localhost/solr/coll1/update/csv?commit=true&f.merchantList.split=true&f.merchantList.separator=%3A&f.merchantList.encapsulator=
> >
> >> "&escape=\&stream.file=/data/**dump/log_20130101'
> >>
> >> Currently when I load the data, I see this:
> >>        "merchantList": ["16179:10950"],
> >> But I want this:
> >>        "merchantList": ["16179","10950"],
> >>
> >>
> >> This example is int but I have intentionally kept it as a string since
> some
> >> values can also be a string.
> >>
> >> Any suggestions where I am going wrong?
> >>
> >> --
> >> Thanks,
> >> -Utkarsh
> >>
> >
> >
> >
> > --
> > Thanks,
> > -Utkarsh
>



-- 
Thanks,
-Utkarsh

Reply via email to