{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/14063","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/14063/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/14063/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/14063/events","html_url":"https://github.com/elastic/elasticsearch/issues/14063","id":110956296,"number":14063,"title":"Analyzer unassigned when using 'integer' type","user":{"login":"missinglink","id":738069,"avatar_url":"https://avatars.githubusercontent.com/u/738069?v=3","gravatar_id":"","url":"https://api.github.com/users/missinglink","html_url":"https://github.com/missinglink","followers_url":"https://api.github.com/users/missinglink/followers","following_url":"https://api.github.com/users/missinglink/following{/other_user}","gists_url":"https://api.github.com/users/missinglink/gists{/gist_id}","starred_url":"https://api.github.com/users/missinglink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/missinglink/subscriptions","organizations_url":"https://api.github.com/users/missinglink/orgs","repos_url":"https://api.github.com/users/missinglink/repos","events_url":"https://api.github.com/users/missinglink/events{/privacy}","received_events_url":"https://api.github.com/users/missinglink/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-12T11:31:31Z","updated_at":"2015-10-12T12:17:55Z","closed_at":"2015-10-12T12:12:39Z","body":"When assigning an `analyzer` to an `integer` field, the analyzer definition is removed from the mapping.\r\n\r\nIn the example below I would like to remove non-numeric characters from a house number and store the results as `integer` types in order to use a `range` filter (eg. so `[\"1A\"]` => `[1]` or `[\"apt 4\"]` => `[4]`)\r\n\r\nWhen posting the mapping to ES, it is removing the `analyzer` for the `integer` field but not for the `string` field.\r\n\r\nThis results in an unexpected error such as `MapperParsingException[failed to parse [myInteger]]; nested: NumberFormatException[For input string: \\\"apartment 1A\\\"];`.\r\n\r\nI looked through the docs and couldn't find mention of this behaviour.\r\n\r\n```bash\r\n#!/bin/bash\r\n\r\n################################################\r\n# Analyzer unassigned when using 'integer' type\r\n################################################\r\n\r\nES='localhost:9200';\r\n\r\n# drop index\r\ncurl -XDELETE \"$ES/address?pretty=true\";\r\n\r\n# create index\r\ncurl -XPUT \"$ES/address?pretty=true\" -d'\r\n{\r\n  \"settings\": {\r\n    \"analysis\": {\r\n      \"analyzer\": {\r\n        \"numberify\": {\r\n          \"type\": \"custom\",\r\n          \"tokenizer\": \"standard\",\r\n          \"char_filter\": [\"convert_non_numeric_chars_to_spaces\"]\r\n        }\r\n      },\r\n      \"char_filter\": {\r\n        \"convert_non_numeric_chars_to_spaces\": {\r\n          \"type\": \"pattern_replace\",\r\n          \"pattern\": \"[^0-9]\",\r\n          \"replacement\": \" \"\r\n        }\r\n      }\r\n    }\r\n  },\r\n  \"mappings\": {\r\n    \"housenumber\": {\r\n      \"properties\": {\r\n        \"myString\": {\r\n          \"type\": \"string\",\r\n          \"analyzer\": \"numberify\"\r\n        },\r\n        \"myInteger\": {\r\n          \"type\": \"integer\",\r\n          \"analyzer\": \"numberify\"\r\n        }\r\n      }\r\n    }\r\n  }\r\n}';\r\n```\r\n\r\n```bash\r\n# retrieve index mapping\r\ncurl -XGET \"$ES/address/_mapping?pretty=true\"\r\n\r\n# !!! analyzer has been removed from 'integer' field but not string field !!!\r\n\r\n# \"myInteger\" : {\r\n#   \"type\" : \"integer\"\r\n# },\r\n# \"myString\" : {\r\n#   \"type\" : \"string\",\r\n#   \"analyzer\" : \"numberify\"\r\n# }\r\n```\r\n\r\n```bash\r\n# index a doc\r\ncurl -XPOST \"$ES/address/housenumber/1?pretty=true\" -d'\r\n{\r\n  \"myInteger\": \"apartment 1A\",\r\n  \"myString\": \"apartment 1A\"\r\n}';\r\n\r\n# {\r\n#   \"error\" : \"MapperParsingException[failed to parse [myInteger]]; nested: NumberFormatException[For input string: \\\"apartment 1A\\\"]; \",\r\n#   \"status\" : 400\r\n# }\r\n```\r\n\r\n```bash\r\n# expected for input 'apartment 1A'\r\n\r\n\"myInteger\": 1,\r\n\"myString\": \"1\"\r\n```\r\n\r\n```bash\r\n{\r\n  \"status\" : 200,\r\n  \"name\" : \"Mahkizmo\",\r\n  \"cluster_name\" : \"elasticsearch\",\r\n  \"version\" : {\r\n    \"number\" : \"1.7.2\",\r\n    \"build_hash\" : \"e43676b1385b8125d647f593f7202acbd816e8ec\",\r\n    \"build_timestamp\" : \"2015-09-14T09:49:53Z\",\r\n    \"build_snapshot\" : false,\r\n    \"lucene_version\" : \"4.10.4\"\r\n  },\r\n  \"tagline\" : \"You Know, for Search\"\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments/147379267","html_url":"https://github.com/elastic/elasticsearch/issues/14063#issuecomment-147379267","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/14063","id":147379267,"user":{"login":"missinglink","id":738069,"avatar_url":"https://avatars.githubusercontent.com/u/738069?v=3","gravatar_id":"","url":"https://api.github.com/users/missinglink","html_url":"https://github.com/missinglink","followers_url":"https://api.github.com/users/missinglink/followers","following_url":"https://api.github.com/users/missinglink/following{/other_user}","gists_url":"https://api.github.com/users/missinglink/gists{/gist_id}","starred_url":"https://api.github.com/users/missinglink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/missinglink/subscriptions","organizations_url":"https://api.github.com/users/missinglink/orgs","repos_url":"https://api.github.com/users/missinglink/repos","events_url":"https://api.github.com/users/missinglink/events{/privacy}","received_events_url":"https://api.github.com/users/missinglink/received_events","type":"User","site_admin":false},"created_at":"2015-10-12T12:17:55Z","updated_at":"2015-10-12T12:17:55Z","body":"hey @dadoonet where exactly is the discussion going on? I couldn't find this issue over there? Could you elaborate on why you closed the issue? I took the time to write it."}}