# How does the updating put mapping API works to \_all field?

**URL:** <https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803>\
**Category:** Elasticsearch\
**Created:** [January 10, 2016, 10:44am UTC](https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803 "2016-01-10T10:44:05Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Red](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Red](https://discuss.elastic.co/u/Red)\
**Post date:** [January 10, 2016, 10:44am UTC](https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803/1 "2016-01-10T10:44:05Z")

</div>

does the updating post using put mapping API cause reindexing of \_all field ????

i know the field type and something could not be updated, ive updated the date format successfully.

> 1 so i want to know whether the updating to the date type field causes reindexing to \_all field or not.

* * *

> 2 if not, could the \_all field be correctly searched with the new date format?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 10, 2016, 11:25am UTC](https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803/2 "2016-01-10T11:25:31Z")

</div>

Updating a mapping does not cause any reindex operation.

---

<div class="post-metadata">

**Author:** ![Red](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Red](https://discuss.elastic.co/u/Red)\
**Post date:** [January 10, 2016, 4:02pm UTC](https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803/3 "2016-01-10T16:02:10Z")

</div>

thank you for your help  
ive thought that updating the format, will cause es reindex the filed indexed in \_all field.  
because the date field will be put into \_all field as a string,  
updating a date field from YY-MM-dd to YY-MM-dd hh:mm:ss will not make any change to the date field string in \_all?

before updating : field format: 1980-01-01, field as string in \_all could be 1980-01-01 ?

after updating: field format: 1980-01-01 01:01:01, field as string in \_all could be 1980-01-01 01:01:01?

or im just misunderstanding. change date format will not cause any effection to the date value stored in the date format. and also will not change the date value string stored in \_all field.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 10, 2016, 4:39pm UTC](https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803/4 "2016-01-10T16:39:29Z")

</div>

Field \_all won't change.

And BTW using \_all is often a bad idea. You would prefer copy\_to feature.

---

<div class="post-metadata">

**Author:** ![Red](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Red](https://discuss.elastic.co/u/Red)\
**Post date:** [January 11, 2016, 12:44pm UTC](https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803/5 "2016-01-11T12:44:38Z")

</div>

thank you for your help. i see.

and ive made a test. just as you said, updating format will not cause the old date change format.

i thought it would cause the old date changing format form YYYY-MM-dd to YYYY-MM-dd 00:00:00 something.

and from my test. i see.  
before changing: using gte and lte to match a date range is like this:

> [date\_start(YYYY-MM-dd), date\_end(YYYY-MM-dd)]  
> d1: 01-03  
> d2: 01-04  
> d3: 01-05

when i filter "lte 01-04" the document d2:01-04 will match,  
when i filter "gte 01-04" the document d2:01-04 will match,  
the result is reasonable.

after changing: the query use date format YYYY-MM-dd HH:mm:ss

> [date\_start(YYYY-MM-dd), date\_end(YYYY-MM-dd))  
> d1: 01-03  
> d2: 01-04  
> d3: 01-05  
> d4: 01-04 12:00

when i filter "lte 01-04 12:00" the document d2:01-04 will match, even if it doesnt have HH:mm:ss value.  
when i filter "gte 01-04 12:00" the document d2:01-04 will not match,  
i dont get it. why gte does not act like lte

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 11, 2016, 1:09pm UTC](https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803/6 "2016-01-11T13:09:08Z")

</div>

You need to send a full script which reproduces your problem otherwise it's hard to understand and get the full picture.

Check also your mapping and make sure your field is a date.

---

<div class="post-metadata">

**Author:** ![Red](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Red](https://discuss.elastic.co/u/Red)\
**Post date:** [January 12, 2016, 2:21pm UTC](https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803/7 "2016-01-12T14:21:11Z")

</div>

thanks for you attention.  
ive made my execution steps log from xshell.  
ive descripted the problem in it.

the file is too big to show here.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 12, 2016, 2:33pm UTC](https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803/8 "2016-01-12T14:33:38Z")

</div>

use [gist.github.com](http://gist.github.com)

---

<div class="post-metadata">

**Author:** ![Red](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Red](https://discuss.elastic.co/u/Red)\
**Post date:** [January 12, 2016, 2:36pm UTC](https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803/9 "2016-01-12T14:36:58Z")

</div>

ok, ive reply the email with a attach, i think it wont be delivery.

---

<div class="post-metadata">

**Author:** ![Red](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Red](https://discuss.elastic.co/u/Red)\
**Post date:** [January 12, 2016, 2:41pm UTC](https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803/10 "2016-01-12T14:41:31Z")

</div>

> <https://github.com/elastic/elasticsearch/issues/15930>

this is the link

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 12, 2016, 2:53pm UTC](https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803/11 "2016-01-12T14:53:11Z")

</div>

Well. I wrote [http://gist.github.com](http://gist.github.com)  
Not [https://github.com/elastic/elasticsearch/issues/](https://github.com/elastic/elasticsearch/issues/)

Also please read [https://www.elastic.co/help/](https://www.elastic.co/help/)

---

<div class="post-metadata">

**Author:** ![Red](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Red](https://discuss.elastic.co/u/Red)\
**Post date:** [January 13, 2016, 1:53am UTC](https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803/12 "2016-01-13T01:53:27Z")

</div>

ok. im sorry. i cant open [gist.github.com](http://gist.github.com). im in china.  
version im using is 1.5.0. i forget telling you.  
how about give me a email-address if its necessary.

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [January 13, 2016, 10:32pm UTC](https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803/13 "2016-01-13T22:32:56Z")

</div>

How about [pastebin.com](http://pastebin.com)?

---

<div class="post-metadata">

**Author:** ![Red](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Red](https://discuss.elastic.co/u/Red)\
**Post date:** [January 14, 2016, 3:01am UTC](https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803/14 "2016-01-14T03:01:27Z")

</div>

cant open either.😕

---

<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 5, 2017, 11:24pm UTC](https://discuss.elastic.co/t/how-does-the-updating-put-mapping-api-works-to--all-field/38803/15 "2017-07-05T23:24:45Z")

</div>


