-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed as not planned
Labels
:Analytics/AggregationsAggregationsAggregations>enhancementTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)help wantedadoptmeadoptme
Description
Elasticsearch version: 1.7, 2.3
Consider the following example, if field is set to a field that does not exist, no errors are thrown and instead only the range aggregation is returned and the max value is not returned.
PUT rangeagg
{
"mappings": {
"type":{
"properties": {
"intField1":{
"type": "integer"
},
"intField2":{
"type": "integer"
}
}
}
}
}
POST rangeagg/type/1
{
"intField1": 4,
"intField2": 3
}
GET /rangeagg/_search
{
"aggs": {
"test": {
"range": {
"field": "whatever",
"script" : "doc['intField1'].value - doc['intField2'].value",
"ranges": [
{
"from": 0,
"to": 2
}
]
},
"aggs": {
"max": {
"max": {
"field": "intField1"
}
}
}
}
}
}
Returns:
"aggregations": {
"test": {
"buckets": [
{
"key": "0.0-2.0",
"from": 0,
"from_as_string": "0.0",
"to": 2,
"to_as_string": "2.0",
"doc_count": 0
}
]
}
}
Metadata
Metadata
Assignees
Labels
:Analytics/AggregationsAggregationsAggregations>enhancementTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)help wantedadoptmeadoptme