# Update a field, not the entire document

**URL:** https://discuss.elastic.co/t/update-a-field-not-the-entire-document/4155
**Category:** Elasticsearch
**Created:** [March 24, 2011, 11:36am UTC](https://discuss.elastic.co/t/update-a-field-not-the-entire-document/4155 "2011-03-24T11:36:05Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Jason\_Syf](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@Jason\_Syf](https://discuss.elastic.co/u/Jason_Syf)
#### Post date: [March 24, 2011, 11:36am UTC](https://discuss.elastic.co/t/update-a-field-not-the-entire-document/4155/1 "2011-03-24T11:36:05Z")

</div>

Hi,

Are there any plans to allow the update of a specific field in a  
document, instead of indexing the entire document again? This would be  
a common use case for my application, and updating the entire document  
seem inefficient.

Thanks  
Jason

---

<div class="post-metadata">

### Author: ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)
#### Post date: [March 24, 2011, 12:23pm UTC](https://discuss.elastic.co/t/update-a-field-not-the-entire-document/4155/2 "2011-03-24T12:23:32Z")

</div>

Hi,

ES is built on top of Lucene and as long as Lucene can't do this then ES  
can't provide it (efficiently) as well. You can either check the  
parent/child feature [1-4] or consider redesigning your object mapping. May  
be if you can share more about your use case then we could help to find some  
solution.

[1] [Parent / Child Support · Issue #553 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/553)  
[2]  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/top-children-query.html)  
[3]  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/has-child-query.html)  
[4]  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/has-child-filter.html)

Regards,  
Lukas

On Thu, Mar 24, 2011 at 12:36 PM, Jason Syf [jason.syf@gmail.com](mailto:jason.syf@gmail.com) wrote:

> Hi,
> 
> Are there any plans to allow the update of a specific field in a  
> document, instead of indexing the entire document again? This would be  
> a common use case for my application, and updating the entire document  
> seem inefficient.
> 
> Thanks  
> Jason

---

<div class="post-metadata">

### Author: ![danoyoung](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danoyoung](https://discuss.elastic.co/u/danoyoung)
#### Post date: [March 24, 2011, 1:35pm UTC](https://discuss.elastic.co/t/update-a-field-not-the-entire-document/4155/3 "2011-03-24T13:35:35Z")

</div>

Jason,

This is one of the main reasons we decomposed our documents into  
parent/children. Although we do have to rewrite the entire child (or parent)  
document, it's better than rewriting a much larger JSON document.

Regards,

Dan

On Thu, Mar 24, 2011 at 6:23 AM, Lukáš Vlček [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com) wrote:

> Hi,
> 
> ES is built on top of Lucene and as long as Lucene can't do this then ES  
> can't provide it (efficiently) as well. You can either check the  
> parent/child feature [1-4] or consider redesigning your object mapping. May  
> be if you can share more about your use case then we could help to find some  
> solution.
> 
> [1] [Parent / Child Support · Issue #553 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/553)  
> [2]  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/top-children-query.html)  
> [3]  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/has-child-query.html)  
> [4]  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/has-child-filter.html)
> 
> Regards,  
> Lukas
> 
> On Thu, Mar 24, 2011 at 12:36 PM, Jason Syf [jason.syf@gmail.com](mailto:jason.syf@gmail.com) wrote:
> 
> > Hi,
> > 
> > Are there any plans to allow the update of a specific field in a  
> > document, instead of indexing the entire document again? This would be  
> > a common use case for my application, and updating the entire document  
> > seem inefficient.
> > 
> > Thanks  
> > Jason

---

<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: [March 24, 2011, 8:27pm UTC](https://discuss.elastic.co/t/update-a-field-not-the-entire-document/4155/4 "2011-03-24T20:27:46Z")

</div>

Heya,

Parent child do get some support at updating smaller documents, but, they do offer limited functionality (which might fit what you are after).

Yes, updating a single field in Lucene is not possible, and I don't think that Lucene should support that (personal opinion) as it will require too many changes internally and will most definitely affect performance.

That being said, there are cases where elasticsearch can implement updating specific type of fields in a doc outside of Lucene. This is still in the stage of idea floating around, but I do plan to try and tackle this in the near future, and see were it goes.

-shay.banon  
On Thursday, March 24, 2011 at 3:35 PM, Dan Young wrote:

> Jason,
> 
> This is one of the main reasons we decomposed our documents into parent/children. Although we do have to rewrite the entire child (or parent) document, it's better than rewriting a much larger JSON document.
> 
> Regards,
> 
> Dan
> 
> On Thu, Mar 24, 2011 at 6:23 AM, LukÃ¡Å¡ VlÄek [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com) wrote:
> 
> > Hi,
> > 
> > ES is built on top of Lucene and as long as Lucene can't do this then ES can't provide it (efficiently) as well. You can either check the parent/child feature [1-4] or consider redesigning your object mapping. May be if you can share more about your use case then we could help to find some solution.
> > 
> > [1] [Parent / Child Support · Issue #553 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/553)  
> > [2] [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/top-children-query.html)  
> > [3] [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/has-child-query.html)  
> > [4] [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/has-child-filter.html)
> > 
> > Regards,  
> > Lukas
> > 
> > On Thu, Mar 24, 2011 at 12:36 PM, Jason Syf [jason.syf@gmail.com](mailto:jason.syf@gmail.com) wrote:
> > 
> > > Hi,
> > > 
> > > Are there any plans to allow the update of a specific field in a  
> > > document, instead of indexing the entire document again? This would be  
> > > a common use case for my application, and updating the entire document  
> > > seem inefficient.
> > > 
> > > Thanks  
> > > Jason

---

<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, 4:09am UTC](https://discuss.elastic.co/t/update-a-field-not-the-entire-document/4155/5 "2017-07-06T04:09:19Z")

</div>


