0

I tried using curl syntax:
curl http:// localhost:8983/solr/update/csv?stream.file=/usr/local/src/apache-solr-3.6.0/example/exampledocs/my+file.csv&separator=;&stream.contentType=text/plain;charset=utf-8
with no luck.
I get:
-bash: syntax error near unexpected token `;&'

If I try to encoded the semicolon with %3b, it says:

[1] 16319
[2] 16320
-bash: stream.contentType=text/plain: No such file or directory
[2]+ Done separator=%3b
administrator@host:/usr/local/src/apache-solr-3.6.0/example/exampledocs$

<html>  
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 400 undefined field: "field1;field2;field3;field4"</title>
</head>
<body><h2>HTTP ERROR 400</h2>
<p>Problem accessing /solr/update/csv. Reason:
<pre>    undefined field: "field1;field2;field3;field4"</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/>

As you can see the separator was not decoded and the following parameter was not parsed properly.

Can anyone help me encode the semicolon properly?
Or is there another way I could update solr with the csv file on ubuntu?

4

1 に答える 1

0

実際には、二重引用符で囲むと問題が解決しました。

curl "http://localhost:8983/solr/update/csv?stream.file=/usr/local/src/apache-solr-3.6.0/example/exampledocs/my+file.csv&separator=;&stream.contentType= text/plain;charset=utf-8"

ただし、二重引用符で囲むときに空のスペースに + が必要な理由は奇妙です...

于 2012-06-15T09:42:50.563 に答える