# Modifying an existing entry without source

**URL:** <https://discuss.elastic.co/t/modifying-an-existing-entry-without-source/6967>\
**Category:** Elasticsearch\
**Created:** [March 12, 2012, 12:24pm UTC](https://discuss.elastic.co/t/modifying-an-existing-entry-without-source/6967 "2012-03-12T12:24:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thinusp](https://avatars.discourse-cdn.com/v4/letter/t/da6949/32.png) [@thinusp](https://discuss.elastic.co/u/thinusp)\
**Post date:** [March 12, 2012, 12:24pm UTC](https://discuss.elastic.co/t/modifying-an-existing-entry-without-source/6967/1 "2012-03-12T12:24:05Z")

</div>

Is it possible to (through the JAVA API) modify an existing entry when the  
original source is not available? I imagine the process to be that you'll  
have to retrieve the entry in some form, modify the relevant fields, and  
then resubmit the entry where only the modified fields will be updated.  
Something like that...

I am, of course, able to do this when the original source is saved, because  
then I can perfectly reconstruct the index entry as if it is a new one from  
the data obtained from the Get method.

Thanks you...

Thinus

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [March 12, 2012, 1:11pm UTC](https://discuss.elastic.co/t/modifying-an-existing-entry-without-source/6967/2 "2012-03-12T13:11:27Z")

</div>

I am afraid it's not possible at the moment. Elasticsearch is using Lucene  
as an underlying search engine and, unfortunately, there is no update  
operation in Lucene. All updates are basically deletes followed by adds. In  
other words, elasticsearch needs to have access to a complete record in  
order to update it. In theory, elasticsearch could reconstruct source if  
all fields were stored, but it doesn't support that at the moment.

Igor

On Monday, March 12, 2012 8:24:05 AM UTC-4, Thinus Prinsloo wrote:

> Is it possible to (through the JAVA API) modify an existing entry when the  
> original source is not available? I imagine the process to be that you'll  
> have to retrieve the entry in some form, modify the relevant fields, and  
> then resubmit the entry where only the modified fields will be updated.  
> Something like that...
> 
> I am, of course, able to do this when the original source is saved,  
> because then I can perfectly reconstruct the index entry as if it is a new  
> one from the data obtained from the Get method.
> 
> Thanks you...
> 
> Thinus

---

<div class="post-metadata">

**Author:** ![avasilenko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/avasilenko/32/2901_2.png) [@avasilenko](https://discuss.elastic.co/u/avasilenko)\
**Post date:** [March 12, 2012, 1:14pm UTC](https://discuss.elastic.co/t/modifying-an-existing-entry-without-source/6967/3 "2012-03-12T13:14:22Z")

</div>

Igor is correct about underlying storage, however there's workaround in  
0.19.0.  
You can check it here

> **[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.

Alexandr Vasilenko

2012/3/12 Igor Motov [imotov@gmail.com](mailto:imotov@gmail.com)

> I am afraid it's not possible at the moment. Elasticsearch is using Lucene  
> as an underlying search engine and, unfortunately, there is no update  
> operation in Lucene. All updates are basically deletes followed by adds. In  
> other words, elasticsearch needs to have access to a complete record in  
> order to update it. In theory, elasticsearch could reconstruct source if  
> all fields were stored, but it doesn't support that at the moment.
> 
> Igor
> 
> On Monday, March 12, 2012 8:24:05 AM UTC-4, Thinus Prinsloo wrote:
> 
> > Is it possible to (through the JAVA API) modify an existing entry when  
> > the original source is not available? I imagine the process to be that  
> > you'll have to retrieve the entry in some form, modify the relevant fields,  
> > and then resubmit the entry where only the modified fields will be updated.  
> > Something like that...
> > 
> > I am, of course, able to do this when the original source is saved,  
> > because then I can perfectly reconstruct the index entry as if it is a new  
> > one from the data obtained from the Get method.
> > 
> > Thanks you...
> > 
> > Thinus

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 12, 2012, 1:24pm UTC](https://discuss.elastic.co/t/modifying-an-existing-entry-without-source/6967/4 "2012-03-12T13:24:03Z")

</div>

On Mon, 2012-03-12 at 15:14 +0200, Alex Vasilenko wrote:

> Igor is correct about underlying storage, however there's workaround  
> in 0.19.0.  
> You can check it  
> here [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/update.html)

This only works if the source field is enabled, and from the OP, it  
sounds like it isn't

clint

> Alexandr Vasilenko
> 
> 2012/3/12 Igor Motov [imotov@gmail.com](mailto:imotov@gmail.com)  
> I am afraid it's not possible at the moment. Elasticsearch is  
> using Lucene as an underlying search engine and,  
> unfortunately, there is no update operation in Lucene. All  
> updates are basically deletes followed by adds. In other  
> words, elasticsearch needs to have access to a complete record  
> in order to update it. In theory, elasticsearch could  
> reconstruct source if all fields were stored, but it doesn't  
> support that at the moment.
> 
> ```
> Igor
>     
> On Monday, March 12, 2012 8:24:05 AM UTC-4, Thinus Prinsloo
> wrote:
> Is it possible to (through the JAVA API) modify an
> existing entry when the original source is not
> available? I imagine the process to be that you'll
> have to retrieve the entry in some form, modify the
> relevant fields, and then resubmit the entry where
> only the modified fields will be updated. Something
> like that...
>             
>             
> I am, of course, able to do this when the original
> source is saved, because then I can perfectly
> reconstruct the index entry as if it is a new one from
> the data obtained from the Get method.
>             
>             
> Thanks you...
>             
>             
> Thinus
> 
> ```

---

<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:36am UTC](https://discuss.elastic.co/t/modifying-an-existing-entry-without-source/6967/5 "2017-07-06T03:36:23Z")

</div>

Closed on July 6, 2017, 3:36am UTC


