# Basic question on Indexing

**URL:** <https://discuss.elastic.co/t/basic-question-on-indexing/12156>\
**Category:** Elasticsearch\
**Created:** [May 28, 2013, 7:02pm UTC](https://discuss.elastic.co/t/basic-question-on-indexing/12156 "2013-05-28T19:02:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hari/32/1582_2.png) [@hari](https://discuss.elastic.co/u/hari)\
**Post date:** [May 28, 2013, 7:02pm UTC](https://discuss.elastic.co/t/basic-question-on-indexing/12156/1 "2013-05-28T19:02:25Z")

</div>

I have tried to read through documentation and forum and did not really see  
a pointed answer to internals of how this works in ES.

I understand that One or more Types can be part of an index, E.g. Product  
index with product variation and product attributes type  
Each document (Product) has an ID in Elasticsearch, and a document can be  
updated by performing an index operation using Product ID.

My question is when I update a product by ID, is ES re-indexing only the  
document (Product ID) or is it re-indexing complete product index?

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [May 28, 2013, 7:40pm UTC](https://discuss.elastic.co/t/basic-question-on-indexing/12156/2 "2013-05-28T19:40:07Z")

</div>

Hello,

When you update a document by ID, only that document gets re-indexed, not  
the complete index.

Actually, the way I understand it works is that a new document is indexed,  
while the old one gets marked as deleted (and will eventually be physically  
removed during a  
merge[http://www.elasticsearch.org/guide/reference/index-modules/merge/](http://www.elasticsearch.org/guide/reference/index-modules/merge/)  
).

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

On Tue, May 28, 2013 at 10:02 PM, Hariharan Vadivelu [hariinfo@gmail.com](mailto:hariinfo@gmail.com)wrote:

> I have tried to read through documentation and forum and did not really  
> see a pointed answer to internals of how this works in ES.
> 
> I understand that One or more Types can be part of an index, E.g. Product  
> index with product variation and product attributes type  
> Each document (Product) has an ID in Elasticsearch, and a document can be  
> updated by performing an index operation using Product ID.
> 
> My question is when I update a product by ID, is ES re-indexing only the  
> document (Product ID) or is it re-indexing complete product index?
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![hari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hari/32/1582_2.png) [@hari](https://discuss.elastic.co/u/hari)\
**Post date:** [May 29, 2013, 12:23am UTC](https://discuss.elastic.co/t/basic-question-on-indexing/12156/3 "2013-05-29T00:23:54Z")

</div>

Thanks Radhu, so I tested update to the same document twice and then when I  
check index status number of delete operation shows as 0, so I assume  
although ES may be internally performing delete of old document and then  
merging but this data is not really available through index status API.

curl -XPUT [http://localhost:9200/blog/article/1](http://localhost:9200/blog/article/1) -d '{"title": "New version  
of Elastic Search released!", "content": "...content1", "tags":  
["announce", "elasticsearch", "release"] }'  
curl -XPUT [http://localhost:9200/blog/article/1](http://localhost:9200/blog/article/1) -d '{"title": "New version  
of Elastic Search released!", "content": "...content2", "tags":  
["announce", "elasticsearch", "release"] }'  
curl -XGET '[http://localhost:9200/blog/\_status?pretty=true](http://localhost:9200/blog/_status?pretty=true)'

On Tuesday, May 28, 2013 2:40:07 PM UTC-5, Radu Gheorghe wrote:

> Hello,
> 
> When you update a document by ID, only that document gets re-indexed, not  
> the complete index.
> 
> Actually, the way I understand it works is that a new document is indexed,  
> while the old one gets marked as deleted (and will eventually be physically  
> removed during a merge[http://www.elasticsearch.org/guide/reference/index-modules/merge/](http://www.elasticsearch.org/guide/reference/index-modules/merge/)  
> ).
> 
> ## Best regards, Radu
> 
> [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> 
> On Tue, May 28, 2013 at 10:02 PM, Hariharan Vadivelu \<[hari...@gmail.com](mailto:hari...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > I have tried to read through documentation and forum and did not really  
> > see a pointed answer to internals of how this works in ES.
> > 
> > I understand that One or more Types can be part of an index, E.g. Product  
> > index with product variation and product attributes type  
> > Each document (Product) has an ID in Elasticsearch, and a document can be  
> > updated by performing an index operation using Product ID.
> > 
> > My question is when I update a product by ID, is ES re-indexing only the  
> > document (Product ID) or is it re-indexing complete product index?
> > 
> > --  
> > 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:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:34am UTC](https://discuss.elastic.co/t/basic-question-on-indexing/12156/4 "2017-07-06T02:34:16Z")

</div>


