Range Aggregation - Default 'key' [ES 1.1.1]

In running the following range aggregation [choosing not to specify a 'key'
for each range]

{
"query": {
"match_all": {}
},
"aggs": {
"duration": {
"range": {
"field": "duration",
"ranges": [
{ "to": 60 },
{ "from": 60, "to": 300},
{ "from": 300, "to": 900},
{ "from": 900, "to": 3600},
{ "from": 3600 }
]
}
}
}
}

I seem to be alternating between two result sets, the first request will
return:
"aggregations": {
"duration": {
"buckets": [
{
"to": 60,
"doc_count": 157680
},
{
"from": 60,
"to": 300,
"doc_count": 181398
},
{
"from": 300,
"to": 900,
"doc_count": 39937
},
{
"from": 900,
"to": 3600,
"doc_count": 8809
},
{
"from": 3600,
"doc_count": 298
}
]
}
}

And the subsequent request will return:
"aggregations": {
"duration": {
"buckets": [
{
"key": "-60.0",
"to": 60,
"doc_count": 157680
},
{
"key": "60.0-300.0",
"from": 60,
"to": 300,
"doc_count": 181398
},
{
"key": "300.0-900.0",
"from": 300,
"to": 900,
"doc_count": 39937
},
{
"key": "900.0-3600.0",
"from": 900,
"to": 3600,
"doc_count": 8809
},
{
"key": "3600.0-
",
"from": 3600,
"doc_count": 298
}
]
}
}

Each request afterwards alternates between "key" being absent from each
bucket in the list and then being present. Was hoping someone might have
some insight as to what is going on just to satisfy my own curiosity.

--
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/840a3619-2736-49e9-97b3-06a5b2fea9d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

How many nodes do you have in your cluster?

If you have 2 nodes then it would suggest that there is something different
between the two nodes which is causing this and your request is alternating
between each of the nodes.

My first guess would be that the nodes are accidentally on different
versions.

I would start by using the nodes API to confirm the nodes are all on the
same version of Elasticsearch:

curl -XGET "http://localhost:9200/_nodes/settings"

Hope this helps

Colin

On Tuesday, 17 February 2015 17:39:16 UTC, Scott Rallya wrote:

In running the following range aggregation [choosing not to specify a
'key' for each range]

{
"query": {
"match_all": {}
},
"aggs": {
"duration": {
"range": {
"field": "duration",
"ranges": [
{ "to": 60 },
{ "from": 60, "to": 300},
{ "from": 300, "to": 900},
{ "from": 900, "to": 3600},
{ "from": 3600 }
]
}
}
}
}

I seem to be alternating between two result sets, the first request will
return:
"aggregations": {
"duration": {
"buckets": [
{
"to": 60,
"doc_count": 157680
},
{
"from": 60,
"to": 300,
"doc_count": 181398
},
{
"from": 300,
"to": 900,
"doc_count": 39937
},
{
"from": 900,
"to": 3600,
"doc_count": 8809
},
{
"from": 3600,
"doc_count": 298
}
]
}
}

And the subsequent request will return:
"aggregations": {
"duration": {
"buckets": [
{
"key": "-60.0",
"to": 60,
"doc_count": 157680
},
{
"key": "60.0-300.0",
"from": 60,
"to": 300,
"doc_count": 181398
},
{
"key": "300.0-900.0",
"from": 300,
"to": 900,
"doc_count": 39937
},
{
"key": "900.0-3600.0",
"from": 900,
"to": 3600,
"doc_count": 8809
},
{
"key": "3600.0-
",
"from": 3600,
"doc_count": 298
}
]
}
}

Each request afterwards alternates between "key" being absent from each
bucket in the list and then being present. Was hoping someone might have
some insight as to what is going on just to satisfy my own curiosity.

--
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/65724db4-f1a0-4015-8a3d-924c7b1f73a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.