Solr使用cURL删除索引 [英] Solr delete Index using cURL
问题描述
我正在尝试从Solr中删除所有记录。我可以在浏览器中通过发布以下URL
I'm trying to delete all records from Solr. I can do this in the browser by posting the following URL
http://localhost:8983/solr/update?stream.body=<delete><query>*:*</query></delete>
但我希望使用命令行。我已经安装cURL,并测试了命令行理解curl命令。但是当我发出以下命令
However I wish to do it using the commmand line. I've installed cURL and have tested that the command line understands curl commands. But when I issue the following command
curl http://localhost:8983/solr/update --data '<delete><query>*:*</query></delete>' -H 'Content-type:text/xml; charset=utf-8'
我收到错误
<这是意外的
< was unexpected at this time
我尝试了各种不同的变化使用单引号或双引号包装xml,但没有什么似乎工作。
I have tried various different variations using single or double quotes to wrap the xml in, but nothing seems to work. Can anybody shed any light?
提前感谢。
推荐答案
下面是一个如何使用curl删除solr索引的示例:
Here is an example of how to delete a solr index with curl:
https://gist.github.com/nz/673027
对于Windows,请查看:
For windows, check this out:
如何使用cmd在Windows 7中使用cURL发布XML数据?
这篇关于Solr使用cURL删除索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!