{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch-migration/issues/23","labels_url":"https://api.github.com/repos/elastic/elasticsearch-migration/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch-migration/issues/23/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch-migration/issues/23/events","html_url":"https://github.com/elastic/elasticsearch-migration/issues/23","id":103486180,"number":23,"title":"Defining default_index and default_search analyzers sets type-level index and search analyzers","user":{"login":"clintongormley","id":56599,"avatar_url":"https://avatars.githubusercontent.com/u/56599?v=3","gravatar_id":"","url":"https://api.github.com/users/clintongormley","html_url":"https://github.com/clintongormley","followers_url":"https://api.github.com/users/clintongormley/followers","following_url":"https://api.github.com/users/clintongormley/following{/other_user}","gists_url":"https://api.github.com/users/clintongormley/gists{/gist_id}","starred_url":"https://api.github.com/users/clintongormley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clintongormley/subscriptions","organizations_url":"https://api.github.com/users/clintongormley/orgs","repos_url":"https://api.github.com/users/clintongormley/repos","events_url":"https://api.github.com/users/clintongormley/events{/privacy}","received_events_url":"https://api.github.com/users/clintongormley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-27T11:17:46Z","updated_at":"2015-08-27T11:17:50Z","closed_at":null,"body":"_From @rayward on August 27, 2015 1:48_\n\nThe migration plugin is complaining that I have type-level analyzers configured for all my types:\r\n\r\n> Type-level analyzer settings\r\nanalyzer, search_analyzer and index_analyzer settings have been removed and will use the index defaults instead, in type: foo.\r\n\r\nI've pinned it down to the `default_index` and `default_search` definitions on the index analysis settings.\r\n\r\n```\r\ncurl -XPUT localhost:9200/test -d '\r\n{\r\n  \"index\": {\r\n    \"analysis\": {\r\n      \"analyzer\": {\r\n        \"default_search\": {\r\n          \"filter\": [\r\n            \"standard\",\r\n            \"lowercase\",\r\n            \"stop\",\r\n            \"asciifolding\"\r\n          ],\r\n          \"tokenizer\": \"standard\",\r\n          \"type\": \"custom\"\r\n        },\r\n        \"default_index\": {\r\n          \"filter\": [\r\n            \"standard\",\r\n            \"lowercase\",\r\n            \"stop\",\r\n            \"asciifolding\"\r\n          ],\r\n          \"tokenizer\": \"standard\",\r\n          \"type\": \"custom\"\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n'\r\n```\r\n\r\n```\r\ncurl -XPUT localhost:9200/test/foo/_mapping -d '{\"foo\": {\"properties\":{}}}'\r\n```\r\n\r\n```\r\ncurl -XGET localhost:9200/test/foo/_mapping?pretty\r\n```\r\n\r\n```json\r\n{\r\n  \"test\" : {\r\n    \"mappings\" : {\r\n      \"foo\" : {\r\n        \"index_analyzer\" : \"default_index\",\r\n        \"search_analyzer\" : \"default_search\",\r\n        \"properties\" : { }\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nIs the how the intended behaviour of `default_index` and `default_search` (to set type-level analyzers)?\r\n\r\nDoes this mean in 2.0 I have to explicitly set the analyzers for all string fields now rather than being able to use a default that I define?\r\n\r\nPerhaps the docs for default analyzers also needs updating then? \r\nhttps://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-analyzers.html#default-analyzers\n\n_Copied from original issue: elastic/elasticsearch#13134_"},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch-migration/issues/comments/135390766","html_url":"https://github.com/elastic/elasticsearch-migration/issues/23#issuecomment-135390766","issue_url":"https://api.github.com/repos/elastic/elasticsearch-migration/issues/23","id":135390766,"user":{"login":"clintongormley","id":56599,"avatar_url":"https://avatars.githubusercontent.com/u/56599?v=3","gravatar_id":"","url":"https://api.github.com/users/clintongormley","html_url":"https://github.com/clintongormley","followers_url":"https://api.github.com/users/clintongormley/followers","following_url":"https://api.github.com/users/clintongormley/following{/other_user}","gists_url":"https://api.github.com/users/clintongormley/gists{/gist_id}","starred_url":"https://api.github.com/users/clintongormley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clintongormley/subscriptions","organizations_url":"https://api.github.com/users/clintongormley/orgs","repos_url":"https://api.github.com/users/clintongormley/repos","events_url":"https://api.github.com/users/clintongormley/events{/privacy}","received_events_url":"https://api.github.com/users/clintongormley/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T11:17:49Z","updated_at":"2015-08-27T11:17:49Z","body":"_From @rayward on August 27, 2015 4:5_\n\n@rjernst thanks for clarifying, I think it's just a bit confusing because I never explicitly specified the type-level analyzers on the mapping, ES picked it up from from the index level settings.\r\n\r\nI'm not even sure how to even remove them actually (perhaps because they're not actually set on the \r\n\r\n```\r\ncurl -XPUT localhost:9200/test/foo/_mapping -d '{\"foo\": {\"properties\":{}, \"search_analyzer\": null}}'\r\n{\"error\":\"NullPointerException[null]\",\"status\":500}\r\n```\r\n```\r\ncurl -XPUT localhost:9200/test/foo/_mapping -d '{\"foo\": {\"properties\":{}, \"search_analyzer\": \"\"}}'\r\n{\"error\":\"MapperParsingException[Analyzer [] not found for search_analyzer setting on root type [foo]]\",\"status\":400}\r\n```\r\n\r\nNor will it even let me change it:\r\n\r\n```\r\ncurl -XPUT localhost:9200/test/foo/_mapping -d '{\"foo\": {\"properties\":{}, \"search_analyzer\": \"standard\"}}'\r\n```\r\n\r\nThe mapping still looks the same:\r\n\r\n```\r\ncurl -XGET localhost:9200/test/foo/_mapping?pretty\r\n{\r\n  \"test\" : {\r\n    \"mappings\" : {\r\n      \"foo\" : {\r\n        \"index_analyzer\" : \"default_index\",\r\n        \"search_analyzer\" : \"default_search\",\r\n        \"properties\" : { }\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nAm I doing something fundamentally wrong?\r\n"}}