Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
solr导入csv文件错误_Csv_Solr_Import - Fatal编程技术网

solr导入csv文件错误

solr导入csv文件错误,csv,solr,import,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 d

我正在尝试使用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>

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

请告诉我们哪个是正确的目录。谢谢
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