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 mitra <mi...@ornext.com> on 2012/11/09 08:09:26 UTC

indexing CSV using Solr 3.6.1

Hello guys

im trying to index the example CSV in example docs i.e books.csv from solr

how ever im stuck with it from such a long time here is how i started

*** Installed tomcat and have set it up at localhost:7070
*** Solr 3.6 at locahost:7070/solr

I have downloaded curl from the following page http://curl.haxx.se/dlwiz/

i have extracted it and tried curl on cmd and tested it out and works fine

now from Solrwiki updateCSV i have tried all the things possible but couldnt
get it to work
heres what ive tried




D:\curl-7.27.0-ssl-sspi-zlib-static-bin-w32>curl
http://localhost:7070/solr/update/csv --data-binary @books.csv -H
'Content-type:text/plain; charset=utf-8'




<html><head><title>Apache Tomcat/7.0.30 - Error report</title> </head><body>
HTTP Status 400 - missing content stream
<HR size="1" noshade="noshade"><p>*type* Status report</p><p>*message*
<u>missing content stream</u></p><p>*description* <u>The request sent by the
clien
t was syntactically incorrect.</u></p><HR size="1" noshade="noshade">
Apache Tomcat/7.0.30
</body></html>curl: (6) Could not resolve host: charset=utf-8'; No data
record of requested type





D:\curl-7.27.0-ssl-sspi-zlib-static-bin-w32>curl
http://localhost:7070/solr/update/csv?stream.file=D:\apache-solr3.6.1\example\exampledocs\books.csv&stream.contentType=text/plain;charset=utf-8




<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int
name="QTime">46</int></lst>
</response>
'stream.contentType' is not recognized as an internal or external command,
operable program or batch file.



D:\curl-7.27.0-ssl-sspi-zlib-static-bin-w32>curl
http://localhost:7070/solr/update/csv?stream.file=books.csv



<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int
name="QTime">5</int></lst>
</response>





Please help me guys could solve it whatsover



--
View this message in context: http://lucene.472066.n3.nabble.com/indexing-CSV-using-Solr-3-6-1-tp4019226.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: indexing CSV using Solr 3.6.1

Posted by Erik Hatcher <er...@gmail.com>.
And you can also do it all entirely from a browser URL bar using stream.file parameter. 

    Erik

On Nov 10, 2012, at 13:17, Yonik Seeley <yo...@lucidworks.com> wrote:

> My guess is that this might have to do with the fact that you are on
> Windows, and shell escaping is different (i.e. curl isn't getting all
> of the parameters and hence isn't sending everything to Solr).
> 
> My first recommendation would be to install cygwin to get a UNIX
> command line environment like Linux & Mac.
> My second recommendation would be to try things first with the stock
> Solr server in the "example" directory.
> 
> -Yonik
> http://lucidworks.com
> 
> 
> On Fri, Nov 9, 2012 at 8:09 AM, mitra <mi...@ornext.com> wrote:
>> Hello guys
>> 
>> im trying to index the example CSV in example docs i.e books.csv from solr
>> 
>> how ever im stuck with it from such a long time here is how i started
>> 
>> *** Installed tomcat and have set it up at localhost:7070
>> *** Solr 3.6 at locahost:7070/solr
>> 
>> I have downloaded curl from the following page http://curl.haxx.se/dlwiz/
>> 
>> i have extracted it and tried curl on cmd and tested it out and works fine
>> 
>> now from Solrwiki updateCSV i have tried all the things possible but couldnt
>> get it to work
>> heres what ive tried
>> 
>> 
>> 
>> 
>> D:\curl-7.27.0-ssl-sspi-zlib-static-bin-w32>curl
>> http://localhost:7070/solr/update/csv --data-binary @books.csv -H
>> 'Content-type:text/plain; charset=utf-8'
>> 
>> 
>> 
>> 
>> <html><head><title>Apache Tomcat/7.0.30 - Error report</title> </head><body>
>> HTTP Status 400 - missing content stream
>> <HR size="1" noshade="noshade"><p>*type* Status report</p><p>*message*
>> <u>missing content stream</u></p><p>*description* <u>The request sent by the
>> clien
>> t was syntactically incorrect.</u></p><HR size="1" noshade="noshade">
>> Apache Tomcat/7.0.30
>> </body></html>curl: (6) Could not resolve host: charset=utf-8'; No data
>> record of requested type
>> 
>> 
>> 
>> 
>> 
>> D:\curl-7.27.0-ssl-sspi-zlib-static-bin-w32>curl
>> http://localhost:7070/solr/update/csv?stream.file=D:\apache-solr3.6.1\example\exampledocs\books.csv&stream.contentType=text/plain;charset=utf-8
>> 
>> 
>> 
>> 
>> <?xml version="1.0" encoding="UTF-8"?>
>> <response>
>> <lst name="responseHeader"><int name="status">0</int><int
>> name="QTime">46</int></lst>
>> </response>
>> 'stream.contentType' is not recognized as an internal or external command,
>> operable program or batch file.
>> 
>> 
>> 
>> D:\curl-7.27.0-ssl-sspi-zlib-static-bin-w32>curl
>> http://localhost:7070/solr/update/csv?stream.file=books.csv
>> 
>> 
>> 
>> <?xml version="1.0" encoding="UTF-8"?>
>> <response>
>> <lst name="responseHeader"><int name="status">0</int><int
>> name="QTime">5</int></lst>
>> </response>
>> 
>> 
>> 
>> 
>> 
>> Please help me guys could solve it whatsover
>> 
>> 
>> 
>> --
>> View this message in context: http://lucene.472066.n3.nabble.com/indexing-CSV-using-Solr-3-6-1-tp4019226.html
>> Sent from the Solr - User mailing list archive at Nabble.com.

Re: indexing CSV using Solr 3.6.1

Posted by Yonik Seeley <yo...@lucidworks.com>.
My guess is that this might have to do with the fact that you are on
Windows, and shell escaping is different (i.e. curl isn't getting all
of the parameters and hence isn't sending everything to Solr).

My first recommendation would be to install cygwin to get a UNIX
command line environment like Linux & Mac.
My second recommendation would be to try things first with the stock
Solr server in the "example" directory.

-Yonik
http://lucidworks.com


On Fri, Nov 9, 2012 at 8:09 AM, mitra <mi...@ornext.com> wrote:
> Hello guys
>
> im trying to index the example CSV in example docs i.e books.csv from solr
>
> how ever im stuck with it from such a long time here is how i started
>
> *** Installed tomcat and have set it up at localhost:7070
> *** Solr 3.6 at locahost:7070/solr
>
> I have downloaded curl from the following page http://curl.haxx.se/dlwiz/
>
> i have extracted it and tried curl on cmd and tested it out and works fine
>
> now from Solrwiki updateCSV i have tried all the things possible but couldnt
> get it to work
> heres what ive tried
>
>
>
>
> D:\curl-7.27.0-ssl-sspi-zlib-static-bin-w32>curl
> http://localhost:7070/solr/update/csv --data-binary @books.csv -H
> 'Content-type:text/plain; charset=utf-8'
>
>
>
>
> <html><head><title>Apache Tomcat/7.0.30 - Error report</title> </head><body>
> HTTP Status 400 - missing content stream
> <HR size="1" noshade="noshade"><p>*type* Status report</p><p>*message*
> <u>missing content stream</u></p><p>*description* <u>The request sent by the
> clien
> t was syntactically incorrect.</u></p><HR size="1" noshade="noshade">
> Apache Tomcat/7.0.30
> </body></html>curl: (6) Could not resolve host: charset=utf-8'; No data
> record of requested type
>
>
>
>
>
> D:\curl-7.27.0-ssl-sspi-zlib-static-bin-w32>curl
> http://localhost:7070/solr/update/csv?stream.file=D:\apache-solr3.6.1\example\exampledocs\books.csv&stream.contentType=text/plain;charset=utf-8
>
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> <lst name="responseHeader"><int name="status">0</int><int
> name="QTime">46</int></lst>
> </response>
> 'stream.contentType' is not recognized as an internal or external command,
> operable program or batch file.
>
>
>
> D:\curl-7.27.0-ssl-sspi-zlib-static-bin-w32>curl
> http://localhost:7070/solr/update/csv?stream.file=books.csv
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> <lst name="responseHeader"><int name="status">0</int><int
> name="QTime">5</int></lst>
> </response>
>
>
>
>
>
> Please help me guys could solve it whatsover
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/indexing-CSV-using-Solr-3-6-1-tp4019226.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: indexing CSV using Solr 3.6.1

Posted by Erick Erickson <er...@gmail.com>.
My guess (and it's nothing more than a guess) is that your tomcat isn't set
up to recognize utf-8. Your first command, for instance, works fine OOB for
the default Jetty container...

FWIW,
Erick


On Fri, Nov 9, 2012 at 2:09 AM, mitra <mi...@ornext.com> wrote:

> Hello guys
>
> im trying to index the example CSV in example docs i.e books.csv from solr
>
> how ever im stuck with it from such a long time here is how i started
>
> *** Installed tomcat and have set it up at localhost:7070
> *** Solr 3.6 at locahost:7070/solr
>
> I have downloaded curl from the following page http://curl.haxx.se/dlwiz/
>
> i have extracted it and tried curl on cmd and tested it out and works fine
>
> now from Solrwiki updateCSV i have tried all the things possible but
> couldnt
> get it to work
> heres what ive tried
>
>
>
>
> D:\curl-7.27.0-ssl-sspi-zlib-static-bin-w32>curl
> http://localhost:7070/solr/update/csv --data-binary @books.csv -H
> 'Content-type:text/plain; charset=utf-8'
>
>
>
>
> <html><head><title>Apache Tomcat/7.0.30 - Error report</title>
> </head><body>
> HTTP Status 400 - missing content stream
> <HR size="1" noshade="noshade"><p>*type* Status report</p><p>*message*
> <u>missing content stream</u></p><p>*description* <u>The request sent by
> the
> clien
> t was syntactically incorrect.</u></p><HR size="1" noshade="noshade">
> Apache Tomcat/7.0.30
> </body></html>curl: (6) Could not resolve host: charset=utf-8'; No data
> record of requested type
>
>
>
>
>
> D:\curl-7.27.0-ssl-sspi-zlib-static-bin-w32>curl
> http://localhost:7070/solr/update/csv?stream.file=D
> :\apache-solr3.6.1\example\exampledocs\books.csv&stream.contentType=text/plain;charset=utf-8
>
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> <lst name="responseHeader"><int name="status">0</int><int
> name="QTime">46</int></lst>
> </response>
> 'stream.contentType' is not recognized as an internal or external command,
> operable program or batch file.
>
>
>
> D:\curl-7.27.0-ssl-sspi-zlib-static-bin-w32>curl
> http://localhost:7070/solr/update/csv?stream.file=books.csv
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> <lst name="responseHeader"><int name="status">0</int><int
> name="QTime">5</int></lst>
> </response>
>
>
>
>
>
> Please help me guys could solve it whatsover
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/indexing-CSV-using-Solr-3-6-1-tp4019226.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>