I want to import some data into ES.
There is an integer field in my template and I want to use strict mapping.
However, there might be the case that in some documents, the specific filed is missing.
What I want to achieve is to have a special value, say null (not the string "null" !) for the documents where the field is missing.
If I perform
if !([my_field]) {
mutate {
add_field => [ "[my_field]", null ]
}
}
... and the type is set to integer in my index template, it will convert it to '0' during import;
Is there a way to keep a special value for missing fields during import?
Or do I have to resort to just assigning a special pre-defined value by convention (e.g. -999)