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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.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使用cURL删除索引_Curl_Solr - Fatal编程技术网

Solr使用cURL删除索引

Solr使用cURL删除索引,curl,solr,Curl,Solr,我正在尝试从Solr中删除所有记录。我可以通过发布以下URL在浏览器中完成此操作 http://localhost:8983/solr/update?stream.body=<delete><query>*:*</query></delete> http://localhost:8983/solr/update?stream.body=*:* 但是,我希望使用COMMAND行执行此操作。我安装了cURL,并测试了命令行是否理解cURL命令。但当

我正在尝试从Solr中删除所有记录。我可以通过发布以下URL在浏览器中完成此操作

http://localhost:8983/solr/update?stream.body=<delete><query>*:*</query></delete>
http://localhost:8983/solr/update?stream.body=*:*
但是,我希望使用COMMAND行执行此操作。我安装了cURL,并测试了命令行是否理解cURL命令。但当我发出以下命令时

curl http://localhost:8983/solr/update --data '<delete><query>*:*</query></delete>' -H 'Content-type:text/xml; charset=utf-8' 
curlhttp://localhost:8983/solr/update --数据“*:*”-H”内容类型:text/xml;字符集=utf-8'
我收到了错误

这在当时是出人意料的

我尝试了各种不同的变体,使用单引号或双引号来包装xml,但似乎没有任何效果。有人能解释一下吗

提前感谢。

试试这些参数

commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'
commit=true-H“内容类型:text/xml”--数据二进制“*:*”
试试这些参数

commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'
commit=true-H“内容类型:text/xml”--数据二进制“*:*”

您没有添加
commit=true
参数

这样会更简单,您只需执行一个HTTP GET请求


curl”http://localhost:8983/solr/collection1/update?commit=true&stream.body=*:*“

您没有添加
commit=true
参数

这样会更简单,您只需执行一个HTTP GET请求

curl”http://localhost:8983/solr/collection1/update?commit=true&stream.body=*:*“