测试环境需要经常删除全部索引,有三种方式可以使用:
1. 直接在浏览器上输入
s
olr 删除全部索引:
http://localhost:8983/solr/update/?stream.body=<delete><query>*:*</query></delete>&stream.contentType=text/xml;charset=utf-8&commit=true
solr 删除指定ID的索引:http://localhost:8080/solr/update/?stream.body=<delete><id>1</id></delete>&stream.contentType=text/xml;charset=utf-8&commit=true
2. 使用post.jar
java -Ddata=args -jar post.jar "<delete>*:*</delete>"
3. 使用curl
curl
http://localhost:8983/solr/update&commit=true --data-binary "<delete>*:*</delete>"