码迷,mamicode.com
首页 > 其他好文 > 详细

[solr] - 索引数据删除

时间:2018-05-17 18:51:18      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:http   image   with   bar   host   节点   too   不能   ima   

删除solr索引数据,使用XML有两种写法:

1)

<delete><id>1</id></delete>
<commit/>

 

2)

<delete><query>id:1</query></delete>
<commit/>

 

删除所有索引,这样写就可以了:

<delete><query>*:*</query></delete>
<commit/>

 

注意:这个<commit/>节点不能少,否则删除动作的事务不会提交。

 

删除索引管理界面运行:

技术分享图片

 

也可以使用POST数据到这个URL方式运行:

http://localhost:8899/solr/mycore/update?wt=json

POST数据为:

技术分享图片
<add commitWithin="1000" overwrite="true">
    <delete>
        <query>id:1</query>
    </delete>
    <commit></commit>
</add>

[solr] - 索引数据删除

标签:http   image   with   bar   host   节点   too   不能   ima   

原文地址:https://www.cnblogs.com/syq816/p/9052591.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!