Dynamic field mapping restrictions


(Rauan Maemirov) #1

I hit a restriction when dynamically added field mapping couldn't be
changed. http://www.elasticsearch.org/guide/reference/mapping/object-type.html
Why is it so strict?

If there are some issues with file format, maybe it could be allowed at
least store values as is?
I mean, if first added field was string, float or int values could be added
as string, without raising an exception'MapperParsingException[Failed to
parse [field_name]];'?

--


(Shay Banon) #2

The main problem comes when a dynamic field is dynamically introduced as a number, so its type is set to a number, but then you try and index a string to it. It will fail because a numeric value and a string value are indexed very differently.

In 0.19.9 you can set on the numeric values a setting that set it to be ignore_malformed to true. What you can't actually do is set it as a global setting for an index. That can prove useful, open an issue?

On Aug 29, 2012, at 6:29 PM, Rauan Maemirov rauan1987@gmail.com wrote:

I hit a restriction when dynamically added field mapping couldn't be changed. http://www.elasticsearch.org/guide/reference/mapping/object-type.html
Why is it so strict?

If there are some issues with file format, maybe it could be allowed at least store values as is?
I mean, if first added field was string, float or int values could be added as string, without raising an exception'MapperParsingException[Failed to parse [field_name]];'?

--

--


(Rauan Maemirov) #3

Here it is: https://github.com/elasticsearch/elasticsearch/issues/2220

Le jeudi 30 août 2012 03:35:34 UTC+6, kimchy a écrit :

The main problem comes when a dynamic field is dynamically introduced as a
number, so its type is set to a number, but then you try and index a string
to it. It will fail because a numeric value and a string value are indexed
very differently.

In 0.19.9 you can set on the numeric values a setting that set it to be
ignore_malformed to true. What you can't actually do is set it as a global
setting for an index. That can prove useful, open an issue?

On Aug 29, 2012, at 6:29 PM, Rauan Maemirov <raua...@gmail.com<javascript:>>
wrote:

I hit a restriction when dynamically added field mapping couldn't be
changed.
http://www.elasticsearch.org/guide/reference/mapping/object-type.html
Why is it so strict?

If there are some issues with file format, maybe it could be allowed at
least store values as is?
I mean, if first added field was string, float or int values could be
added as string, without raising an exception'MapperParsingException[Failed
to parse [field_name]];'?

--

--


(system) #4