{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/12391","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/12391/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/12391/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/12391/events","html_url":"https://github.com/elastic/elasticsearch/issues/12391","id":96498565,"number":12391,"title":"Cryptic error message when mis-spelling a field in geo-distance aggregation","user":{"login":"colings86","id":236731,"avatar_url":"https://avatars.githubusercontent.com/u/236731?v=3","gravatar_id":"","url":"https://api.github.com/users/colings86","html_url":"https://github.com/colings86","followers_url":"https://api.github.com/users/colings86/followers","following_url":"https://api.github.com/users/colings86/following{/other_user}","gists_url":"https://api.github.com/users/colings86/gists{/gist_id}","starred_url":"https://api.github.com/users/colings86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colings86/subscriptions","organizations_url":"https://api.github.com/users/colings86/orgs","repos_url":"https://api.github.com/users/colings86/repos","events_url":"https://api.github.com/users/colings86/events{/privacy}","received_events_url":"https://api.github.com/users/colings86/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Aggregations","name":":Aggregations","color":"009800"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/adoptme","name":"adoptme","color":"207de5"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/bug","name":"bug","color":"9e2c2c"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/v2.0.0","name":"v2.0.0","color":"dddddd"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-22T07:49:50Z","updated_at":"2015-08-18T19:35:39Z","closed_at":null,"body":"Request:\r\n```js\r\nGET _search\r\n{\r\n   \"aggs\": {\r\n      \"nested_geodistance\": {\r\n         \"nested\": {\r\n            \"path\": \"addresses\"\r\n         },\r\n         \"aggs\": {\r\n           \"per_ring\": {\r\n             \"geo_distance\": {\r\n               \"field\": \"addresses.location\",\r\n               \"unit\": \"km\",\r\n               \"orgin\": {\r\n                 \"lat\": 56.78,\r\n                 \"lon\": 12.34\r\n               },\r\n               \"ranges\": [\r\n                 {\r\n                   \"from\": 100,\r\n                   \"to\": 200\r\n                 }\r\n               ]\r\n             }\r\n           }\r\n         }\r\n      }\r\n   }\r\n}\r\n```\r\n\r\nNote that `origin` field is mis-spelt as `orgin`. The error that comes back in the response is:\r\n\r\n```\r\n{\r\n   \"error\": {\r\n      \"root_cause\": [\r\n         {\r\n            \"type\": \"search_parse_exception\",\r\n            \"reason\": \"Unexpected token START_OBJECT in [per_ring].\",\r\n            \"line\": 11,\r\n            \"col\": 28\r\n         }\r\n      ],\r\n      \"type\": \"search_phase_execution_exception\",\r\n      \"reason\": \"all shards failed\",\r\n      \"phase\": \"query\",\r\n      \"grouped\": true,\r\n      \"failed_shards\": [\r\n         {\r\n            \"shard\": 0,\r\n            \"index\": \".scripts\",\r\n            \"node\": \"IzyWUpmzTbmgk1L8LDCRhQ\",\r\n            \"reason\": {\r\n               \"type\": \"search_parse_exception\",\r\n               \"reason\": \"Unexpected token START_OBJECT in [per_ring].\",\r\n               \"line\": 11,\r\n               \"col\": 28\r\n            }\r\n         }\r\n      ]\r\n   },\r\n   \"status\": 400\r\n}\r\n```\r\n\r\nThis is very confusing and doesn't actually point to the error. We should improve this"},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments/132327551","html_url":"https://github.com/elastic/elasticsearch/issues/12391#issuecomment-132327551","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/12391","id":132327551,"user":{"login":"HarishAtGitHub","id":5524260,"avatar_url":"https://avatars.githubusercontent.com/u/5524260?v=3","gravatar_id":"","url":"https://api.github.com/users/HarishAtGitHub","html_url":"https://github.com/HarishAtGitHub","followers_url":"https://api.github.com/users/HarishAtGitHub/followers","following_url":"https://api.github.com/users/HarishAtGitHub/following{/other_user}","gists_url":"https://api.github.com/users/HarishAtGitHub/gists{/gist_id}","starred_url":"https://api.github.com/users/HarishAtGitHub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HarishAtGitHub/subscriptions","organizations_url":"https://api.github.com/users/HarishAtGitHub/orgs","repos_url":"https://api.github.com/users/HarishAtGitHub/repos","events_url":"https://api.github.com/users/HarishAtGitHub/events{/privacy}","received_events_url":"https://api.github.com/users/HarishAtGitHub/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T19:35:39Z","updated_at":"2015-08-18T19:35:39Z","body":"made a pull request : https://github.com/elastic/elasticsearch/pull/12971\r\n\r\nNote : The problem will go away here  geo distance . But will be present in a number of other parsers.\r\n\r\nmay be  each other parser can be fixed as and when some one reports.(as the number of locations depending in token variable is huge)"}}