solr导入csv文件错误

时间:2014-07-02 15:53:40

标签: csv solr import

我正在尝试使用CURL将CSV文件导入SOLR 4.8.1。它给了我一个错误,它期望CSV输入中的字段名称。我正在示例文件中导入与SOLR一起打包的books.csv文件!

任何人都知道他们的头顶有什么问题吗?感谢。

$ curl http://localhost:8983/solr/collection1/update/csv --data-binary @books.csv -H 'Content-type:text/csv; charset=utf-8'

Warning: Couldn't read data from file "books.csv", this makes an empty POST.
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader">
<int name="status">400</int>
<int name="QTime">0</int></lst>
<lst name="error"><str name="msg">Expected fieldnames in CSV input</str><int name="code">400</int></lst>
</response>

books.csv前四行。

id,cat,name,price,inStock,author,series_t,sequence_i,genre_s
0553573403,book,A Game of Thrones,7.99,true,George R.R. Martin,"A Song of Ice and Fire",1,fantasy
0553579908,book,A Clash of Kings,7.99,true,George R.R. Martin,"A Song of Ice and Fire",2,fantasy
055357342X,book,A Storm of Swords,7.99,true,George R.R. Martin,"A Song of Ice and Fire",3,fantasy

1 个答案:

答案 0 :(得分:0)

找到它。文件位于错误的目录中。