Solr使用cURL删除索引
我正在尝试从Solr中删除所有记录。我可以通过发布以下URL在浏览器中完成此操作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命令。但当
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=*:*“