Default value for field in mapping when not present during indexing

I would like to set a default value of 0 for an integer field if the key/value is not present when doing an index or bulk index. I tried using "null_value" : 0 in my mapping, but that doesn't appear to handle missing key/values during indexing.

Is there something like a default_value for mapping?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.