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 Utkarsh Sengar <ut...@gmail.com> on 2013/10/10 22:51:18 UTC

Using split in updateCSV for SolrCloud 4.4

Hello,

I am trying to use 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=
"&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

Re: Using split in updateCSV for SolrCloud 4.4

Posted by Jack Krupansky <ja...@basetechnology.com>.
Yeah, I notiiced that too and tried that as well, and tried it in 4.4 as 
well, and tried a raw URL in the Chrome browser as well, and it all works 
fine.

Did you try my example with the standard Solr example schema?

I'm trying to see what's different from your example and mine, other than 
the field name.

My latest test case was with this URL in Chrome:

http://localhost:8983/solr/update/csv?commit=true&f.features_ss.split=true&f.features_ss.separator=%3A&f.features_ss.encapsulator=%22&stream.contentType=text/csv&stream.file=test.csv

With this content for test.csv:

id,name,features_ss,junk_s
doc-1,doc1,"feat1:feat2",junk

Can you confirm whether this exact case works for you?

-- Jack Krupansky

-----Original Message----- 
From: Utkarsh Sengar
Sent: Thursday, October 10, 2013 8:48 PM
To: solr-user@lucene.apache.org
Subject: Re: Using split in updateCSV for SolrCloud 4.4

@Jack I just noticed in your example that: feat1:feat2 is not in an
encapsulator ".
Was that a typo or intentional?

You are passing f.features.encapsulator=%22 but don't have " around
feat1:feat2. The request should look:

curl "
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"'


Thanks,
-Utkarsh



On Thu, Oct 10, 2013 at 5:10 PM, Utkarsh Sengar 
<ut...@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<http://localhost/solr/coll1/update/csv?commit=true&f.merchantList.split=true&f.merchantList.separator=%3A&f.merchantList.encapsulator=%22&escape=%5C&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 
> <ja...@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 


Re: Using split in updateCSV for SolrCloud 4.4

Posted by Utkarsh Sengar <ut...@gmail.com>.
@Jack I just noticed in your example that: feat1:feat2 is not in an
encapsulator ".
Was that a typo or intentional?

You are passing f.features.encapsulator=%22 but don't have " around
feat1:feat2. The request should look:

curl "
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"'


Thanks,
-Utkarsh



On Thu, Oct 10, 2013 at 5:10 PM, Utkarsh Sengar <ut...@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<http://localhost/solr/coll1/update/csv?commit=true&f.merchantList.split=true&f.merchantList.separator=%3A&f.merchantList.encapsulator=%22&escape=%5C&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 <ja...@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

Re: Using split in updateCSV for SolrCloud 4.4

Posted by Jack Krupansky <ja...@basetechnology.com>.
There is this note for escape: "If an escape is specified, the encapsulator 
is not used unless also explicitly specified since most formats use either 
encapsulation or escaping, not both."

-- Jack Krupansky

-----Original Message----- 
From: Utkarsh Sengar
Sent: Friday, October 11, 2013 4:35 PM
To: solr-user@lucene.apache.org
Subject: Re: Using split in updateCSV for SolrCloud 4.4

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 <ys...@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 <ut...@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 <jack@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 


Re: Using split in updateCSV for SolrCloud 4.4

Posted by Utkarsh Sengar <ut...@gmail.com>.
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 <ys...@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 <ut...@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 <jack@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

Re: Using split in updateCSV for SolrCloud 4.4

Posted by Yonik Seeley <ys...@gmail.com>.
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 <ut...@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 <ja...@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

Re: Using split in updateCSV for SolrCloud 4.4

Posted by Utkarsh Sengar <ut...@gmail.com>.
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 <ja...@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

Re: Using split in updateCSV for SolrCloud 4.4

Posted by Jack Krupansky <ja...@basetechnology.com>.
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" 
 -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 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=
"&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