Closed
Description
NEST/Elasticsearch.Net version: 2.1.0
Elasticsearch version: 2.3.0
Description of the problem including expected versus actual behavior:
Sigma
is specified as an int?
on ExtendedStatsBucketAggregation
but it should be a double?
(based on the docs of Extended Stats Aggregation).
Sending a number without decimal places throws a parse exception on Elasticsearch 2.3.0:
Request:
{
"size": 0,
"aggs": {
"projects_started_per_month": {
"date_histogram": {
"field": "startedOn",
"interval": "month"
},
"aggs": {
"commits": {
"sum": {
"field": "numberOfCommits"
}
}
}
},
"extended_stats_commits_per_month": {
"extended_stats_bucket": {
"buckets_path": "projects_started_per_month>commits",
"sigma": 2
}
}
}
}
Response:
"error" : {
"root_cause" : [ {
"type" : "parse_exception",
"reason" : "Parameter [sigma] must be a Double, type `Integer` provided instead"
} ],
"type" : "search_phase_execution_exception",
"reason" : "all shards failed",
"phase" : "query",
"grouped" : true,
"failed_shards" : [ {
"shard" : 0,
"index" : "project",
"node" : "afZfSF7hQoqmZQip5n3-LQ",
"reason" : {
"type" : "parse_exception",
"reason" : "Parameter [sigma] must be a Double, type `Integer` provided instead"
}
} ]
},
"status" : 500
}
Steps to reproduce:
- Run the ExtendedStatsBucketAggregationUsageTests.
- Changing
Sigma
todouble?
fixes the problem. This would be a binary break for NEST 2.x however 😞
See also elastic/elasticsearch#17499 - I filed an issue as I think Elasticsearch should also accept an integer value for sigma
(and deserialize to double on the server side).
Metadata
Metadata
Assignees
Labels
No labels