1. 程式人生 > >[solr 管理界面] - 索引數據刪除

[solr 管理界面] - 索引數據刪除

with 否則 update let post數據 clas del pan 事務

刪除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 管理界面] - 索引數據刪除