Mode Aggregation
A single-value metrics aggregation that computes the mode of numeric values that are extracted from the aggregated documents.
The mode of a set of data values is the value that appears most often, in other words, it is the value that is most likely to be sampled. 1
Type | Description | Example | Result |
---|---|---|---|
Mean (or !verage) | Sum of values of a data set divided by number of values | (1+2+2+3+4+7+9) / 7 | 4 |
Median | Middle value separating the greater and lesser halves of a data set | 1, 2, 2, 3, 4, 7, 9 | 3 |
Mode | Most frequent value in a data set | 1, 2, 2, 3, 4, 7, 9 | 2 |
SEARCH /bank/
{
"_query": "*",
"_limit": 0,
"_check_at_least": 1000,
"_aggs": {
"balance_mode": {
"_mode": {
"_field": "balance"
}
}
}
}