{"action":"opened","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/15056","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/15056/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/15056/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/15056/events","html_url":"https://github.com/elastic/elasticsearch/issues/15056","id":119158516,"number":15056,"title":"ElasticSearch does not respect the mapping types","user":{"login":"anujgandharv","id":1678221,"avatar_url":"https://avatars.githubusercontent.com/u/1678221?v=3","gravatar_id":"","url":"https://api.github.com/users/anujgandharv","html_url":"https://github.com/anujgandharv","followers_url":"https://api.github.com/users/anujgandharv/followers","following_url":"https://api.github.com/users/anujgandharv/following{/other_user}","gists_url":"https://api.github.com/users/anujgandharv/gists{/gist_id}","starred_url":"https://api.github.com/users/anujgandharv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anujgandharv/subscriptions","organizations_url":"https://api.github.com/users/anujgandharv/orgs","repos_url":"https://api.github.com/users/anujgandharv/repos","events_url":"https://api.github.com/users/anujgandharv/events{/privacy}","received_events_url":"https://api.github.com/users/anujgandharv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-27T09:16:24Z","updated_at":"2015-11-27T09:16:24Z","closed_at":null,"body":"HI,\r\n I am working with Elasticsearch 2.1.0.\r\nI have a requirement to specify the schema for my documents.\r\nSo i used the ElasticSearch Mapping functionality like this:\r\n\r\ncurl -XPUT 'http://localhost:9200/customer/external/_mapping' -d ' { \"external\" : { \"properties\" : { \"example\" : { \"properties\" : { \"custom_property\" : { \"type\" : \"byte\" } } } } } } '\r\n\r\nIt gets reflected in the schema mapping as well:\r\n\r\n{\r\n  \"customer\" : {\r\n    \"mappings\" : {\r\n      \"external\" : {\r\n        \"properties\" : {\r\n          \"first\" : {\r\n            \"type\" : \"long\"\r\n          },\r\n          \"example\" : {\r\n            \"properties\" : {\r\n              \"custom_property\" : {\r\n                \"type\" : \"byte\"\r\n              },\r\n              \"last\" : {\r\n                \"type\" : \"long\"\r\n              }\r\n            }\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\nI then added the value for this field like this:\r\n\r\ncurl -XPUT 'localhost:9200/customer/external/1?pretty' -d '{\"example\": {\"custom_property\": 12345}}'\r\n\r\nAnd to my surprise it was saved successfully. Here is the output : \r\n\r\n{\r\n  \"_index\" : \"customer\",\r\n  \"_type\" : \"external\",\r\n  \"_id\" : \"1\",\r\n  \"_version\" : 3,\r\n  \"found\" : true,\r\n  \"_source\":{\"example\": {\"custom_property\": 12345}}\r\n}\r\n\r\nI did some more investigation and found that the value is treated as short and not as byte. \r\n\r\nThere is a similar issue with float dataType as well. Can someone explain what may be causing this and how can this be rectified?\r\n\r\nThanks,\r\nAnuj Kumar"}}