简体   繁体   中英

cleaning deleted documents from solr index

I'm using solr on my website but I have small problem. Indexing works great.

I've deleted a few documents from my database (I had 50 documents now I have 41). I've started dataimport, solr tells that he indexed 41 documents (great), deleted 0 (strange). The problem is that I can still search the deleted documents. Why is that? I used clean=true but it didn't change anything.

How can I delete from the index documents that don't exist?

Weird. DataImportHandler with clean=true should work out for your need. An alternative with the benefit of avoiding to stress and eventually messing up the live solr instance is to swap: you create a new index B without touching the live one (say A). B is created from scratch, so will be completely synchronized with your db! Ones that B is created just launch .../admin/cores/?action=SWAP&core=A&other=B and the job is done! I'm doing it with a 1M docs index on Solr 3.5 and works well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM