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


(Red) #1

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?


(David Pilato) #2

Updating a mapping does not cause any reindex operation.


(Red) #3

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.


(David Pilato) #4

Field _all won't change.

And BTW using _all is often a bad idea. You would prefer copy_to feature.


(Red) #5

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


(David Pilato) #6

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.


(Red) #7

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.


(David Pilato) #8

use gist.github.com


(Red) #9

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


(Red) #10

this is the link


(David Pilato) #11

Well. I wrote http://gist.github.com
Not https://github.com/elastic/elasticsearch/issues/

Also please read https://www.elastic.co/help/


(Red) #12

ok. im sorry. i cant open 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.


(Ivan Brusic) #13

How about pastebin.com?


(Red) #14

cant open either.:confused:


(system) #15