# Delete support

**URL:** <https://discuss.elastic.co/t/delete-support/5273>\
**Category:** Elasticsearch\
**Created:** [August 29, 2011, 6:53pm UTC](https://discuss.elastic.co/t/delete-support/5273 "2011-08-29T18:53:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qin\_Zhang](https://avatars.discourse-cdn.com/v4/letter/q/848f3c/32.png) [@Qin\_Zhang](https://discuss.elastic.co/u/Qin_Zhang)\
**Post date:** [August 29, 2011, 6:53pm UTC](https://discuss.elastic.co/t/delete-support/5273/1 "2011-08-29T18:53:56Z")

</div>

Hi,

I'm a new user of elastic search and like what I've seen so far. I have  
some questions on versioning support:  
It seems that each update creates a new version of the document. I'm  
concerned about the index grow overtime since our app will have frequent  
updates on some objects.

1. Can I clean up the index by deleting old versions of a document?
2. In some cases I actually don't want to create a new version when updating  
a document. Is there any API support for this in-place update?

Thanks,

-Qin Zhang  
Model N.

---

<div class="post-metadata">

**Author:** ![Kun\_Niu](https://avatars.discourse-cdn.com/v4/letter/k/8c91f0/32.png) [@Kun\_Niu](https://discuss.elastic.co/u/Kun_Niu)\
**Post date:** [August 29, 2011, 6:56pm UTC](https://discuss.elastic.co/t/delete-support/5273/2 "2011-08-29T18:56:34Z")

</div>

You can delete document using TransportClient or json request.

If you want to update a document, you can use the same id to update the  
record.

Kun Niu

From: [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com) [[mailto:elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)]  
On Behalf Of Qin Zhang  
Sent: 2011年8月30日 2:54  
To: [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
Subject: delete support

Hi,

I'm a new user of elastic search and like what I've seen so far. I have  
some questions on versioning support:

It seems that each update creates a new version of the document. I'm  
concerned about the index grow overtime since our app will have frequent  
updates on some objects.

1. Can I clean up the index by deleting old versions of a document?

2. In some cases I actually don't want to create a new version when updating  
a document. Is there any API support for this in-place update?

Thanks,

-Qin Zhang

Model N.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 29, 2011, 7:05pm UTC](https://discuss.elastic.co/t/delete-support/5273/3 "2011-08-29T19:05:19Z")

</div>

When you update a document, what effectively happens is that the document  
gets reindexed again as if it was a new document, and the "old" document  
gets marked as deleted. In the background, there is a merge process going  
around that expunges deleted docs (among other things). (this is all Lucene,  
btw). There isn't a way to do an "in place update", you can only "reindex" a  
doc with updated values.

On Mon, Aug 29, 2011 at 9:53 PM, Qin Zhang [qzhang@modeln.com](mailto:qzhang@modeln.com) wrote:

> Hi,
> 
> I'm a new user of Elasticsearch and like what I've seen so far. I have  
> some questions on versioning support:  
> It seems that each update creates a new version of the document. I'm  
> concerned about the index grow overtime since our app will have frequent  
> updates on some objects.
> 
> 1. Can I clean up the index by deleting old versions of a document?
> 2. In some cases I actually don't want to create a new version when  
> updating a document. Is there any API support for this in-place update?
> 
> Thanks,
> 
> -Qin Zhang  
> Model N.

---

<div class="post-metadata">

**Author:** ![Qin\_Zhang](https://avatars.discourse-cdn.com/v4/letter/q/848f3c/32.png) [@Qin\_Zhang](https://discuss.elastic.co/u/Qin_Zhang)\
**Post date:** [August 29, 2011, 9:02pm UTC](https://discuss.elastic.co/t/delete-support/5273/4 "2011-08-29T21:02:32Z")

</div>

Thank you. This is actually the behavior that I want, most of the times. I  
was just confused about the versioning feature that was introduced recently.  
Can you clarify further what kind of update creates a new version and keeps  
both versions that can be queried? I read the  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/index_.html) and I thought  
that that all updates create a new version and keep the old version, instead  
of marking the "old" as deleted...

On Mon, Aug 29, 2011 at 12:05 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> When you update a document, what effectively happens is that the document  
> gets reindexed again as if it was a new document, and the "old" document  
> gets marked as deleted. In the background, there is a merge process going  
> around that expunges deleted docs (among other things). (this is all Lucene,  
> btw). There isn't a way to do an "in place update", you can only "reindex" a  
> doc with updated values.
> 
> On Mon, Aug 29, 2011 at 9:53 PM, Qin Zhang [qzhang@modeln.com](mailto:qzhang@modeln.com) wrote:
> 
> > Hi,
> > 
> > I'm a new user of Elasticsearch and like what I've seen so far. I have  
> > some questions on versioning support:  
> > It seems that each update creates a new version of the document. I'm  
> > concerned about the index grow overtime since our app will have frequent  
> > updates on some objects.
> > 
> > 1. Can I clean up the index by deleting old versions of a document?
> > 2. In some cases I actually don't want to create a new version when  
> > updating a document. Is there any API support for this in-place update?
> > 
> > Thanks,
> > 
> > -Qin Zhang  
> > Model N.

--

Qin Zhang | Senior Director, Product Development | Model _N_, Inc. | Direct:  
650.610.4845| Fax: 650.610.4699 | [qzhang@modeln.com](mailto:qzhang@modeln.com) | [www.modeln.com](http://www.modeln.com)

Model _N_: The Leader in Revenue Management

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 30, 2011, 11:05am UTC](https://discuss.elastic.co/t/delete-support/5273/5 "2011-08-30T11:05:27Z")

</div>

Versioning does not mean keeping old versions around to be searchable. It  
just means that documents now have a version associated with them.

On Tue, Aug 30, 2011 at 12:02 AM, Qin Zhang [qzhang@modeln.com](mailto:qzhang@modeln.com) wrote:

> Thank you. This is actually the behavior that I want, most of the times.  
> I was just confused about the versioning feature that was introduced  
> recently. Can you clarify further what kind of update creates a new version  
> and keeps both versions that can be queried? I read the  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/index_.html) and I thought  
> that that all updates create a new version and keep the old version, instead  
> of marking the "old" as deleted...
> 
> On Mon, Aug 29, 2011 at 12:05 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > When you update a document, what effectively happens is that the document  
> > gets reindexed again as if it was a new document, and the "old" document  
> > gets marked as deleted. In the background, there is a merge process going  
> > around that expunges deleted docs (among other things). (this is all Lucene,  
> > btw). There isn't a way to do an "in place update", you can only "reindex" a  
> > doc with updated values.
> > 
> > On Mon, Aug 29, 2011 at 9:53 PM, Qin Zhang [qzhang@modeln.com](mailto:qzhang@modeln.com) wrote:
> > 
> > > Hi,
> > > 
> > > I'm a new user of Elasticsearch and like what I've seen so far. I have  
> > > some questions on versioning support:  
> > > It seems that each update creates a new version of the document. I'm  
> > > concerned about the index grow overtime since our app will have frequent  
> > > updates on some objects.
> > > 
> > > 1. Can I clean up the index by deleting old versions of a document?
> > > 2. In some cases I actually don't want to create a new version when  
> > > updating a document. Is there any API support for this in-place update?
> > > 
> > > Thanks,
> > > 
> > > -Qin Zhang  
> > > Model N.
> 
> --
> 
> Qin Zhang | Senior Director, Product Development | Model _N_, Inc. |  
> Direct: 650.610.4845| Fax: 650.610.4699 | [qzhang@modeln.com](mailto:qzhang@modeln.com) |  
> [www.modeln.com](http://www.modeln.com)
> 
> Model _N_: The Leader in Revenue Management

---

<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, 3:55am UTC](https://discuss.elastic.co/t/delete-support/5273/6 "2017-07-06T03:55:37Z")

</div>


