# Doubt on updating mappings

**URL:** <https://discuss.elastic.co/t/doubt-on-updating-mappings/2936>\
**Category:** Elasticsearch\
**Created:** [May 3, 2010, 7:53am UTC](https://discuss.elastic.co/t/doubt-on-updating-mappings/2936 "2010-05-03T07:53:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahendra\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahendra_m/32/3128_2.png) [@Mahendra\_M](https://discuss.elastic.co/u/Mahendra_M)\
**Post date:** [May 3, 2010, 7:53am UTC](https://discuss.elastic.co/t/doubt-on-updating-mappings/2936/1 "2010-05-03T07:53:10Z")

</div>

Hi,

Had a few queries on using mappings. Mostly noob questions. I checked  
the docs, but I was unable to find the answers.

I noticed this behaviour while testing ES.

- On a particular index, I have 100 documents indexed.
- After this, I update the mapping ( updated include\_in\_all & store  
for a few fields )
- After this, I try a search query for \_all fields and also with the  
'fields' argument
- I noticed that my mapping update has not taken effect.
- Now, I re-index the 100 documents and my queries work with the new mapping.

Am I doing the thing wrong or is this how it is designed ? As in, if  
mapping is updated, then all documents have to be re-indexed for the  
new mapping to be applicable on them.

On a similar topic, does this apply to index configuration also.  
Say I have an index with 2 shards and 2 replicas each. I have X  
documents indexed. If I re-configure the index with 3 shards and 4  
replicas, will things be taken care of automatically ? Or should I  
re-index the documents again ?

PS: Elastic Search is really a wonderful tool 🙂

Regards,  
Mahendra

[http://twitter.com/mahendra](http://twitter.com/mahendra)

---

<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:** [May 3, 2010, 8:28am UTC](https://discuss.elastic.co/t/doubt-on-updating-mappings/2936/2 "2010-05-03T08:28:34Z")

</div>

When updating mappings, you might have conflicts. Conflicts mean that you  
are trying to set something that can't be set. By default in 0.6, conflicts  
are ignored. I changed it to not be ignored in upcoming 0.7 so things will  
be more obvious. You can always control that using the ignore\_conflicts  
parameter.

In your case, trying to change some settings on an existing mapper, it is  
considered as a conflict. In the future, some settings might be applied  
dynamically, though without reindexing, just for new data indexed.

Note, buy the way, that you can upgrade an existing single mapping into a  
multi\_field mapping, which is nice. Then, you can add more mapping on that  
multi\_field mapping (its not considered a conflict). But, this will only  
apply to new data indexed.

cheers,  
shay.banon

On Mon, May 3, 2010 at 10:53 AM, Mahendra M [mahendra.m@gmail.com](mailto:mahendra.m@gmail.com) wrote:

> Hi,
> 
> Had a few queries on using mappings. Mostly noob questions. I checked  
> the docs, but I was unable to find the answers.
> 
> I noticed this behaviour while testing ES.
> 
> - On a particular index, I have 100 documents indexed.
> - After this, I update the mapping ( updated include\_in\_all & store  
> for a few fields )
> - After this, I try a search query for \_all fields and also with the  
> 'fields' argument
> - I noticed that my mapping update has not taken effect.
> - Now, I re-index the 100 documents and my queries work with the new  
> mapping.
> 
> Am I doing the thing wrong or is this how it is designed ? As in, if  
> mapping is updated, then all documents have to be re-indexed for the  
> new mapping to be applicable on them.
> 
> On a similar topic, does this apply to index configuration also.  
> Say I have an index with 2 shards and 2 replicas each. I have X  
> documents indexed. If I re-configure the index with 3 shards and 4  
> replicas, will things be taken care of automatically ? Or should I  
> re-index the documents again ?
> 
> PS: Elastic Search is really a wonderful tool 🙂
> 
> Regards,  
> Mahendra
> 
> [http://twitter.com/mahendra](http://twitter.com/mahendra)

---

<div class="post-metadata">

**Author:** ![Mahendra\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahendra_m/32/3128_2.png) [@Mahendra\_M](https://discuss.elastic.co/u/Mahendra_M)\
**Post date:** [May 3, 2010, 1:30pm UTC](https://discuss.elastic.co/t/doubt-on-updating-mappings/2936/3 "2010-05-03T13:30:55Z")

</div>

On Mon, May 3, 2010 at 1:58 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:

> In your case, trying to change some settings on an existing mapper, it is  
> considered as a conflict. In the future, some settings might be applied  
> dynamically, though without reindexing, just for new data indexed.

Sounds good. So, if I have to change the mapping, I will re-index the  
data. Though in production, this will be a very very rare scenario.

Thanks,  
Mahendra

---

<div class="post-metadata">

**Author:** ![mooky](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mooky](https://discuss.elastic.co/u/mooky)\
**Post date:** [May 3, 2010, 4:10pm UTC](https://discuss.elastic.co/t/doubt-on-updating-mappings/2936/4 "2010-05-03T16:10:49Z")

</div>

Since elastic stores the raw data, it's possible the re-indexing could  
be done entirely internally, no?

-N

On 3 May 2010, at 14:30, Mahendra M [mahendra.m@gmail.com](mailto:mahendra.m@gmail.com) wrote:

> On Mon, May 3, 2010 at 1:58 PM, Shay Banon \<[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)
> 
> > wrote:  
> > In your case, trying to change some settings on an existing mapper,  
> > it is  
> > considered as a conflict. In the future, some settings might be  
> > applied  
> > dynamically, though without reindexing, just for new data indexed.
> 
> Sounds good. So, if I have to change the mapping, I will re-index the  
> data. Though in production, this will be a very very rare scenario.
> 
> Thanks,  
> Mahendra

---

<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:** [May 3, 2010, 4:52pm UTC](https://discuss.elastic.co/t/doubt-on-updating-mappings/2936/5 "2010-05-03T16:52:05Z")

</div>

Yep, if storing the \_source is enabled, then there can be an "index\_to" API  
that will completely reindex one index into another.

On Mon, May 3, 2010 at 7:10 PM, Nick Minutello [nick.minutello@gmail.com](mailto:nick.minutello@gmail.com)wrote:

> Since elastic stores the raw data, it's possible the re-indexing could be  
> done entirely internally, no?
> 
> -N
> 
> On 3 May 2010, at 14:30, Mahendra M [mahendra.m@gmail.com](mailto:mahendra.m@gmail.com) wrote:
> 
> On Mon, May 3, 2010 at 1:58 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)
> 
> > wrote:
> > 
> > > In your case, trying to change some settings on an existing mapper, it is  
> > > considered as a conflict. In the future, some settings might be applied  
> > > dynamically, though without reindexing, just for new data indexed.
> > 
> > Sounds good. So, if I have to change the mapping, I will re-index the  
> > data. Though in production, this will be a very very rare scenario.
> > 
> > Thanks,  
> > Mahendra

---

<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:24am UTC](https://discuss.elastic.co/t/doubt-on-updating-mappings/2936/6 "2017-07-06T04:24:19Z")

</div>


