{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/10536","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/10536/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/10536/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/10536/events","html_url":"https://github.com/elastic/elasticsearch/pull/10536","id":67650292,"number":10536,"title":"Improve exception message when indexing a boolean value into a numeric field","user":{"login":"polyfractal","id":1224228,"avatar_url":"https://avatars.githubusercontent.com/u/1224228?v=3","gravatar_id":"","url":"https://api.github.com/users/polyfractal","html_url":"https://github.com/polyfractal","followers_url":"https://api.github.com/users/polyfractal/followers","following_url":"https://api.github.com/users/polyfractal/following{/other_user}","gists_url":"https://api.github.com/users/polyfractal/gists{/gist_id}","starred_url":"https://api.github.com/users/polyfractal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polyfractal/subscriptions","organizations_url":"https://api.github.com/users/polyfractal/orgs","repos_url":"https://api.github.com/users/polyfractal/repos","events_url":"https://api.github.com/users/polyfractal/events{/privacy}","received_events_url":"https://api.github.com/users/polyfractal/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Mapping","name":":Mapping","color":"009800"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/enhancement","name":"enhancement","color":"4a4ea8"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-10T18:05:55Z","updated_at":"2015-07-09T19:21:11Z","closed_at":"2015-07-09T19:21:11Z","pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/10536","html_url":"https://github.com/elastic/elasticsearch/pull/10536","diff_url":"https://github.com/elastic/elasticsearch/pull/10536.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/10536.patch"},"body":"Makes the exception consistent with other \"incorrect data type\" exceptions, instead of a cryptic internal exception due to trying to derive a long from VALUE_BOOLEAN.\r\n\r\nNew exception will look like this:\r\n\r\n```\r\nPUT /tweets/\r\n{\r\n   \"mappings\": {\r\n      \"tweet\": {\r\n         \"properties\": {\r\n            \"key\": {\r\n               \"type\": \"integer\"\r\n            }\r\n         }\r\n      }\r\n   }\r\n}\r\n\r\nPUT /tweets/tweet/1\r\n{ \"key\" : true }\r\n```\r\n```\r\n{\r\n   \"error\": \"MapperParsingException[failed to parse [key]]; nested: NumberFormatException[For input boolean value: true]; \",\r\n   \"status\": 400\r\n}\r\n```\r\n\r\nInstead of the existing message:\r\n\r\n```\r\n{\r\n  \"error\": \"MapperParsingException[failed to parse [key]]; nested: JsonParseException[Current token (VALUE_TRUE) not numeric, can not use numeric value accessors\\n at [Source: [B@464291b8; line: 1, column: 15]]; \",\r\n  \"status\": 400\r\n}\r\n```\r\n\r\n\r\nFixes #10056"},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments/120115916","html_url":"https://github.com/elastic/elasticsearch/pull/10536#issuecomment-120115916","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/10536","id":120115916,"user":{"login":"s1monw","id":973334,"avatar_url":"https://avatars.githubusercontent.com/u/973334?v=3","gravatar_id":"","url":"https://api.github.com/users/s1monw","html_url":"https://github.com/s1monw","followers_url":"https://api.github.com/users/s1monw/followers","following_url":"https://api.github.com/users/s1monw/following{/other_user}","gists_url":"https://api.github.com/users/s1monw/gists{/gist_id}","starred_url":"https://api.github.com/users/s1monw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s1monw/subscriptions","organizations_url":"https://api.github.com/users/s1monw/orgs","repos_url":"https://api.github.com/users/s1monw/repos","events_url":"https://api.github.com/users/s1monw/events{/privacy}","received_events_url":"https://api.github.com/users/s1monw/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T19:21:11Z","updated_at":"2015-07-09T19:21:11Z","body":"I closed the issue... will do so here"}}