# Segments marked as deleted?

**URL:** <https://discuss.elastic.co/t/segments-marked-as-deleted/21953>\
**Category:** Elasticsearch\
**Created:** [February 3, 2015, 7:26am UTC](https://discuss.elastic.co/t/segments-marked-as-deleted/21953 "2015-02-03T07:26:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jason_zhang/32/745_2.png) [@Jason\_Zhang](https://discuss.elastic.co/u/Jason_Zhang)\
**Post date:** [February 3, 2015, 7:26am UTC](https://discuss.elastic.co/t/segments-marked-as-deleted/21953/1 "2015-02-03T07:26:55Z")

</div>

Hi,

I use segmentspy to detect segment merges in ES. But I find there's  
several "Deleted Docs" which is like "Deleted Docs: 1.55630".  
I know ES will mark items as deleted and remove them later through GC.

But what's the meaning of those deleted segments? Why does ES/lucene not  
remove them? There's no updates in this index since 10 days ago.  
How can I clean them out explicitly?

Thank you.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 3, 2015, 7:30am UTC](https://discuss.elastic.co/t/segments-marked-as-deleted/21953/2 "2015-02-03T07:30:33Z")

</div>

ES removes deleted docs via merging, not GC.

You can force a merge using the optimise API -

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

- but be aware that it is resource intensive. Also be sure to read this  
blog post -  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/lucenes-handling-of-deleted-documents/)

On 3 February 2015 at 18:26, Jason Zhang [mock2u@gmail.com](mailto:mock2u@gmail.com) wrote:

> Hi,
> 
> I use segmentspy to detect segment merges in ES. But I find there's  
> several "Deleted Docs" which is like "Deleted Docs: 1.55630".  
> I know ES will mark items as deleted and remove them later through GC.
> 
> But what's the meaning of those deleted segments? Why does ES/lucene not  
> remove them? There's no updates in this index since 10 days ago.  
> How can I clean them out explicitly?
> 
> Thank you.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X9nurQur0KfHSv9TJgQf9FsoRSKNXOLUjAJaVbnhp9DEg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X9nurQur0KfHSv9TJgQf9FsoRSKNXOLUjAJaVbnhp9DEg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Jason\_Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jason_zhang/32/745_2.png) [@Jason\_Zhang](https://discuss.elastic.co/u/Jason_Zhang)\
**Post date:** [February 3, 2015, 7:44am UTC](https://discuss.elastic.co/t/segments-marked-as-deleted/21953/3 "2015-02-03T07:44:26Z")

</div>

I've tried `curl -XPOST http://foo:9200/bar/_optimize`, but there's still  
some "Deleted Docs" here. Is this normal?

On Tuesday, February 3, 2015 at 3:31:02 PM UTC+8, Mark Walkom wrote:

> ES removes deleted docs via merging, not GC.
> 
> You can force a merge using the optimise API -  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-optimize.html#indices-optimize)
> 
> - but be aware that it is resource intensive. Also be sure to read this  
> blog post -  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/lucenes-handling-of-deleted-documents/)
> 
> On 3 February 2015 at 18:26, Jason Zhang \<[moc...@gmail.com](mailto:moc...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > Hi,
> > 
> > I use segmentspy to detect segment merges in ES. But I find there's  
> > several "Deleted Docs" which is like "Deleted Docs: 1.55630".  
> > I know ES will mark items as deleted and remove them later through GC.
> > 
> > But what's the meaning of those deleted segments? Why does ES/lucene  
> > not remove them? There's no updates in this index since 10 days ago.  
> > How can I clean them out explicitly?
> > 
> > Thank you.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8158bc66-2970-43b3-b771-6bc3d1c6cd87%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8158bc66-2970-43b3-b771-6bc3d1c6cd87%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 3, 2015, 7:52am UTC](https://discuss.elastic.co/t/segments-marked-as-deleted/21953/4 "2015-02-03T07:52:29Z")

</div>

How many?

The amount of deleted docs really depends on the atomicity of the index.

On 3 February 2015 at 18:44, Jason Zhang [mock2u@gmail.com](mailto:mock2u@gmail.com) wrote:

> I've tried `curl -XPOST http://foo:9200/bar/_optimize`  
> [http://foo:9200/bar/\_optimize](http://foo:9200/bar/_optimize), but there's still some "Deleted Docs"  
> here. Is this normal?
> 
> On Tuesday, February 3, 2015 at 3:31:02 PM UTC+8, Mark Walkom wrote:
> 
> > ES removes deleted docs via merging, not GC.
> > 
> > You can force a merge using the optimise API -  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/)  
> > reference/current/indices-optimize.html#indices-optimize - but be aware  
> > that it is resource intensive. Also be sure to read this blog post -  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/lucenes-handling-of-deleted-documents/)
> > 
> > On 3 February 2015 at 18:26, Jason Zhang [moc...@gmail.com](mailto:moc...@gmail.com) wrote:
> > 
> > > Hi,
> > > 
> > > I use segmentspy to detect segment merges in ES. But I find there's  
> > > several "Deleted Docs" which is like "Deleted Docs: 1.55630".  
> > > I know ES will mark items as deleted and remove them later through GC.
> > > 
> > > But what's the meaning of those deleted segments? Why does ES/lucene  
> > > not remove them? There's no updates in this index since 10 days ago.  
> > > How can I clean them out explicitly?
> > > 
> > > Thank you.
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/8158bc66-2970-43b3-b771-6bc3d1c6cd87%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8158bc66-2970-43b3-b771-6bc3d1c6cd87%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/8158bc66-2970-43b3-b771-6bc3d1c6cd87%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8158bc66-2970-43b3-b771-6bc3d1c6cd87%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X8F0FznwO3QBbCkvTwMD2H\_FpyRcDdu8xoPLr6JCU%3D8CA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X8F0FznwO3QBbCkvTwMD2H_FpyRcDdu8xoPLr6JCU%3D8CA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Jason\_Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jason_zhang/32/745_2.png) [@Jason\_Zhang](https://discuss.elastic.co/u/Jason_Zhang)\
**Post date:** [February 3, 2015, 7:53am UTC](https://discuss.elastic.co/t/segments-marked-as-deleted/21953/5 "2015-02-03T07:53:37Z")

</div>

Also I forgot to say I didn't do any deletions in this index.

On Tuesday, February 3, 2015 at 3:31:02 PM UTC+8, Mark Walkom wrote:

> ES removes deleted docs via merging, not GC.
> 
> You can force a merge using the optimise API -  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-optimize.html#indices-optimize)
> 
> - but be aware that it is resource intensive. Also be sure to read this  
> blog post -  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/lucenes-handling-of-deleted-documents/)
> 
> On 3 February 2015 at 18:26, Jason Zhang \<[moc...@gmail.com](mailto:moc...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > Hi,
> > 
> > I use segmentspy to detect segment merges in ES. But I find there's  
> > several "Deleted Docs" which is like "Deleted Docs: 1.55630".  
> > I know ES will mark items as deleted and remove them later through GC.
> > 
> > But what's the meaning of those deleted segments? Why does ES/lucene  
> > not remove them? There's no updates in this index since 10 days ago.  
> > How can I clean them out explicitly?
> > 
> > Thank you.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/68bacf0e-acff-4cc1-8d79-150a6e40c98b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/68bacf0e-acff-4cc1-8d79-150a6e40c98b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Jason\_Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jason_zhang/32/745_2.png) [@Jason\_Zhang](https://discuss.elastic.co/u/Jason_Zhang)\
**Post date:** [February 3, 2015, 8:00am UTC](https://discuss.elastic.co/t/segments-marked-as-deleted/21953/6 "2015-02-03T08:00:13Z")

</div>

Very little.  
Every "Deleted Docs" says like "Deleted Docs: 1.5563", not integer. What  
does the number mean?

The sum may be less than 10 while the index has over 3 million docs.

On Tuesday, February 3, 2015 at 3:52:59 PM UTC+8, Mark Walkom wrote:

> How many?
> 
> The amount of deleted docs really depends on the datomicity of the index.
> 
> On 3 February 2015 at 18:44, Jason Zhang \<[moc...@gmail.com](mailto:moc...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > I've tried `curl -XPOST http://foo:9200/bar/_optimize`  
> > [http://foo:9200/bar/\_optimize](http://foo:9200/bar/_optimize), but there's still some "Deleted Docs"  
> > here. Is this normal?
> > 
> > On Tuesday, February 3, 2015 at 3:31:02 PM UTC+8, Mark Walkom wrote:
> > 
> > > ES removes deleted docs via merging, not GC.
> > > 
> > > You can force a merge using the optimise API -  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/)  
> > > reference/current/indices-optimize.html#indices-optimize - but be aware  
> > > that it is resource intensive. Also be sure to read this blog post -  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/lucenes-handling-of-deleted-documents/)
> > > 
> > > On 3 February 2015 at 18:26, Jason Zhang [moc...@gmail.com](mailto:moc...@gmail.com) wrote:
> > > 
> > > > Hi,
> > > > 
> > > > I use segmentspy to detect segment merges in ES. But I find there's  
> > > > several "Deleted Docs" which is like "Deleted Docs: 1.55630".  
> > > > I know ES will mark items as deleted and remove them later through GC.
> > > > 
> > > > But what's the meaning of those deleted segments? Why does ES/lucene  
> > > > not remove them? There's no updates in this index since 10 days ago.  
> > > > How can I clean them out explicitly?
> > > > 
> > > > Thank you.
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/8158bc66-2970-43b3-b771-6bc3d1c6cd87%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8158bc66-2970-43b3-b771-6bc3d1c6cd87%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/8158bc66-2970-43b3-b771-6bc3d1c6cd87%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8158bc66-2970-43b3-b771-6bc3d1c6cd87%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f5e0c11d-5f9d-41e7-97c7-2cf943efe3fb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f5e0c11d-5f9d-41e7-97c7-2cf943efe3fb%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [February 3, 2015, 8:05am UTC](https://discuss.elastic.co/t/segments-marked-as-deleted/21953/7 "2015-02-03T08:05:24Z")

</div>

This only means that segment merging is going on. This produces generations  
of segments that are obsolete, these are internally marked as "deleted".  
Later the obsolete generations are cleaned up automatically when the  
segment is touched by significant amount of new data. Do not worry about  
that, there is nothing you should do. Of course, you can play with  
\_optimize API, but the downside is imposing heavy load on the node.

Jörg

On Tue, Feb 3, 2015 at 8:26 AM, Jason Zhang [mock2u@gmail.com](mailto:mock2u@gmail.com) wrote:

> Hi,
> 
> I use segmentspy to detect segment merges in ES. But I find there's  
> several "Deleted Docs" which is like "Deleted Docs: 1.55630".  
> I know ES will mark items as deleted and remove them later through GC.
> 
> But what's the meaning of those deleted segments? Why does ES/lucene not  
> remove them? There's no updates in this index since 10 days ago.  
> How can I clean them out explicitly?
> 
> Thank you.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHf3pu24P\_fEd70i\_8kqVjhJQG\_27TLuKz99qd08iwhWA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHf3pu24P_fEd70i_8kqVjhJQG_27TLuKz99qd08iwhWA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 3, 2015, 8:13am UTC](https://discuss.elastic.co/t/segments-marked-as-deleted/21953/8 "2015-02-03T08:13:32Z")

</div>

Yeah but if you update a doc, it will delete and insert behind the scene.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 3 févr. 2015 à 08:53, Jason Zhang [mock2u@gmail.com](mailto:mock2u@gmail.com) a écrit :
> 
> Also I forgot to say I didn't do any deletions in this index.
> 
> > On Tuesday, February 3, 2015 at 3:31:02 PM UTC+8, Mark Walkom wrote:  
> > ES removes deleted docs via merging, not GC.
> > 
> > You can force a merge using the optimise API - [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-optimize.html#indices-optimize) - but be aware that it is resource intensive. Also be sure to read this blog post - [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/lucenes-handling-of-deleted-documents/)
> > 
> > > On 3 February 2015 at 18:26, Jason Zhang [moc...@gmail.com](mailto:moc...@gmail.com) wrote:  
> > > Hi,
> > > 
> > > I use segmentspy to detect segment merges in ES. But I find there's several "Deleted Docs" which is like "Deleted Docs: 1.55630".  
> > > I know ES will mark items as deleted and remove them later through GC.
> > > 
> > > But what's the meaning of those deleted segments? Why does ES/lucene not remove them? There's no updates in this index since 10 days ago.  
> > > How can I clean them out explicitly?
> > > 
> > > ## Thank you.
> > > 
> > > You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8f0458a6-53ee-4e38-a3cc-6564eb693040%40googlegroups.com).  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/68bacf0e-acff-4cc1-8d79-150a6e40c98b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/68bacf0e-acff-4cc1-8d79-150a6e40c98b%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/240D0E50-75E6-49E3-B6FB-D41049FBF54D%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/240D0E50-75E6-49E3-B6FB-D41049FBF54D%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:35am UTC](https://discuss.elastic.co/t/segments-marked-as-deleted/21953/9 "2017-07-06T00:35:15Z")

</div>


