I am using a statistical facet (@see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-statistical-facet.html) to perform an aggregation on a few fields across the documents in my Elastic Search index.
I was wondering if anyone knew if the API provided a means to provide a default value if a particular field does not exist. For example, if a field does not exist use 0 (zero) as that fields value. By default it seems to give a null pointer exception when the aggregation is taking place.
My initial thoughts are to utilize a script field to test if the aggregation field is null and perform the default 0 logic there.