I would have thought that range aggregations return the bucket list in the
order the range agg is listed, but I'm not seeing that result. (ES 1.3.2)
Is there a way to enforce original ordering that I'm missing?
My range aggregation:
"day_of_week_range": {
"range": {
"field": "sessions.events.days_of_week",
"ranges": [
{"from":0, "to":5, "key": "Weekdays"},
{"from":5, "to":7, "key": "Weekends"},
{"from":6, "to":6, "key": "Sunday"},
{"from":0, "to":1, "key": "Monday"},
{"from":1, "to":2, "key": "Tuesday"},
{"from":2, "to":3, "key": "Wednesday"},
{"from":3, "to":4, "key": "Thursday"},
{"from":4, "to":5, "key": "Friday"},
{"from":5, "to":6, "key": "Saturday"}
]
}
}
And the response (Note that Weekdays is 2nd in the response, which is why
I'm posting):
"day_of_week_range": {
"buckets": [
{
"key": "Monday",
"from": 0,
"from_as_string": "0.0",
"to": 1,
"to_as_string": "1.0",
"doc_count": 11
},
{
"key": "Weekdays",
"from": 0,
"from_as_string": "0.0",
"to": 5,
"to_as_string": "5.0",
"doc_count": 40
},
{
"key": "Tuesday",
"from": 1,
"from_as_string": "1.0",
"to": 2,
"to_as_string": "2.0",
"doc_count": 11
},
{
"key": "Wednesday",
"from": 2,
"from_as_string": "2.0",
"to": 3,
"to_as_string": "3.0",
"doc_count": 10
},
{
"key": "Thursday",
"from": 3,
"from_as_string": "3.0",
"to": 4,
"to_as_string": "4.0",
"doc_count": 17
},
{
"key": "Friday",
"from": 4,
"from_as_string": "4.0",
"to": 5,
"to_as_string": "5.0",
"doc_count": 15
},
{
"key": "Saturday",
"from": 5,
"from_as_string": "5.0",
"to": 6,
"to_as_string": "6.0",
"doc_count": 28
},
{
"key": "Weekends",
"from": 5,
"from_as_string": "5.0",
"to": 7,
"to_as_string": "7.0",
"doc_count": 37
},
{
"key": "Sunday",
"from": 6,
"from_as_string": "6.0",
"to": 6,
"to_as_string": "6.0",
"doc_count": 0
}
]
}
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9a245439-0fd8-4dd3-888b-43ec882c0e16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.