Deleted docs


(megAmin) #1

wenever i update by re-indexing the previous docs are marked as deleted docs. how to delete those docs?


(Shay Banon) #2

Thats how Lucene works. Deleted docs are just marked as deleted, and
eventually gets expunged when internal index segments gets merged. This can
be explicitly invoked using the optimized API:
http://www.elasticsearch.com/docs/elasticsearch/rest_api/admin/indices/optimize/.
Note the special flag of only_expunge_deletes which only optimizes segments
that have deletes.

As a side note, optimize is a heavy operation. If you end up deleting a
large potion of your index when you reindex, you might as well create a new
index under a different name, do then reindexing into it, and then delete
the old index. You can use index aliases to do this seamlessly (
http://www.elasticsearch.com/docs/elasticsearch/rest_api/admin/indices/aliases/)
from other searches. Not sure if this is what you are trying to do, but
might help.

cheers,
shay.banon

On Fri, Apr 23, 2010 at 6:11 PM, megAmin amin.megha@gmail.com wrote:

wenever i update by re-indexing the previous docs are marked as deleted
docs.
how to delete those docs?

View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Deleted-docs-tp745958p745958.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(system) #3