Background for the discussion can be found at https://discuss.elastic.co/t/is-the-missing-value-option-officially-supported-in-date-range-aggregations/45855/4. The use-case seems to be about grouping missing values with uninteresting values.
We discussed this on FixIt friday and although this feature works today it's totally unsupported (we don't test it, we don't document it).
Pasting here a typical request:
GET myindex/user/_search
{
"aggs": {
"age_groups": {
"date_range": {
"field": "user_date_of_birth",
"missing": "1899-12-31",
"ranges": [
{
"key": "Generation Z",
"from": "2000"
},
{
"key": "Generation Y",
"from": "1980",
"to": "2000"
},
{
"key": "Generation X",
"from": "1965",
"to": "1980"
},
{
"key": "Baby Boomer",
"from": "1946",
"to": "1965"
},
{
"key": "Silent Generation",
"from": "1925",
"to": "1946"
},
{
"key": "Greatest Generation",
"from": "1900",
"to": "1925"
},
{
"key": "Other",
"to": "1900"
}
]
}
}
}
}
Everybody without any age or born before 1900 will fall in the Other
bucket.
There might be interesting use cases coming from the UI team. @rashidkpc WDYT? Should we support officially that kind of feature or simply close this as a non supported/non documented feature we might remove at any time?
I'd keep this, its definitely useful. And from what i understand missing
is valid on most (all?) other bucket aggs
Hi, I am new to GitHub public projects, so if possible I would like to make this my first contribution to the project to get my feet wet. Seems like this just involves writing some tests for this feature and documenting it? If there is any additional related information please let me know.
Thanks.
Most helpful comment
I'd keep this, its definitely useful. And from what i understand
missing
is valid on most (all?) other bucket aggs