{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/95640280","pull_request_review_id":16199231,"id":95640280,"diff_hunk":"@@ -112,7 +111,7 @@ public AllFieldMapper build(BuilderContext context) {\n             // the AllFieldMapper ctor in the builder since it is not valid. Here we validate\n             // the doc values settings (old and new) are rejected\n             Object docValues = node.get(\"doc_values\");\n-            if (docValues != null && lenientNodeBooleanValue(docValues)) {\n+            if (docValues != null && TypeParsers.nodeBooleanValue(name, \"doc_values\", docValues, parserContext)) {","path":"core/src/main/java/org/elasticsearch/index/mapper/AllFieldMapper.java","position":13,"original_position":13,"commit_id":"0577acc3eb57824d0266a705595bbcbb5b062454","original_commit_id":"0577acc3eb57824d0266a705595bbcbb5b062454","user":{"login":"nik9000","id":215970,"avatar_url":"https://avatars.githubusercontent.com/u/215970?v=3","gravatar_id":"","url":"https://api.github.com/users/nik9000","html_url":"https://github.com/nik9000","followers_url":"https://api.github.com/users/nik9000/followers","following_url":"https://api.github.com/users/nik9000/following{/other_user}","gists_url":"https://api.github.com/users/nik9000/gists{/gist_id}","starred_url":"https://api.github.com/users/nik9000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nik9000/subscriptions","organizations_url":"https://api.github.com/users/nik9000/orgs","repos_url":"https://api.github.com/users/nik9000/repos","events_url":"https://api.github.com/users/nik9000/events{/privacy}","received_events_url":"https://api.github.com/users/nik9000/received_events","type":"User","site_admin":false},"body":"Do we need lenient BWC here? I think we might. I know mappings are converted on upgrade but I wonder if we expect people to be able to send `off` to old indexes. I think it is reasonable to tell them that they can't but it is weird to explain the you can for configuring analyzers and can't for mappings....","created_at":"2017-01-11T18:27:53Z","updated_at":"2017-01-11T18:45:17Z","html_url":"https://github.com/elastic/elasticsearch/pull/22200#discussion_r95640280","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/22200","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/95640280"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/22200#discussion_r95640280"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/22200"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/22200","id":98201850,"html_url":"https://github.com/elastic/elasticsearch/pull/22200","diff_url":"https://github.com/elastic/elasticsearch/pull/22200.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/22200.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/22200","number":22200,"state":"open","locked":false,"title":"Make boolean conversion strict","user":{"login":"danielmitterdorfer","id":1699576,"avatar_url":"https://avatars.githubusercontent.com/u/1699576?v=3","gravatar_id":"","url":"https://api.github.com/users/danielmitterdorfer","html_url":"https://github.com/danielmitterdorfer","followers_url":"https://api.github.com/users/danielmitterdorfer/followers","following_url":"https://api.github.com/users/danielmitterdorfer/following{/other_user}","gists_url":"https://api.github.com/users/danielmitterdorfer/gists{/gist_id}","starred_url":"https://api.github.com/users/danielmitterdorfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielmitterdorfer/subscriptions","organizations_url":"https://api.github.com/users/danielmitterdorfer/orgs","repos_url":"https://api.github.com/users/danielmitterdorfer/repos","events_url":"https://api.github.com/users/danielmitterdorfer/events{/privacy}","received_events_url":"https://api.github.com/users/danielmitterdorfer/received_events","type":"User","site_admin":false},"body":"This PR removes all leniency in the conversion of Strings to booleans: \"true\" is converted to the boolean value `true`, \"false\" is converted to the boolean value `false`. Everything else raises an error.\r\n\r\nThis applies to:\r\n\r\n* All settings (index settings, cluster settings)\r\n* Boolean values in the REST API\r\n* Documents\r\n\r\nExceptions are:\r\n\r\n* For indices created before Elasticsearch 6, we still apply the old coercion logic (but we add deprecation logging).\r\n* We allow to omit the value \"true\" for request parameters in the REST API, i.e. `?pretty` is interpreted as `?pretty=true`. \r\n\r\nNoteworthy / to discuss:\r\n\r\n* Bucket term aggregations on boolean fields continue to use `1` and `0` for the `key`, and the strings `\"true\"` and `\"false\"` for the `key_as_string` (I think that's fine).\r\n* Existing index templates can be read after an upgrade *but* creating a new index based on an index template with invalid boolean values will fail (see below for a discussion of the tradeoffs).\r\n\r\nExample scenario (the `lowercase` field of `my_custom_pattern_analyzer` is a boolean field):\r\n\r\n1. Create the following index template on Elasticsearch 5.x:\r\n\r\n```json\r\nDELETE /_template/default_template\r\n\r\nPUT /_template/default_template\r\n{\r\n  \"template\": \"*\",\r\n    \"settings\": {\r\n        \"analysis\": {\r\n            \"analyzer\": {\r\n                \"my_custom_pattern_analyzer\": {\r\n                    \"type\": \"pattern\",\r\n                    \"lowercase\": 0\r\n                }\r\n            }\r\n        }    \r\n    }  \r\n}\r\n```\r\n\r\n2. Upgrade to Elasticsearch 6\r\n\r\n3. Create the following index:\r\n\r\n```\r\nDELETE /test\r\n\r\nPUT /test\r\n```\r\n\r\nResult: Creating the index will fail, because the `lowercase` setting is invalid for a 6.x index.\r\n\r\nAnalysis: When a new index is created, `MetaDataCreateIndexService` will load all matching index templates, merge them settings and apply request settings overrides. By the time the index is created we have no clue where the affected setting came from and before that we don't have enough information to know a value's type.\r\n\r\nDiscussion:\r\n\r\nI can think of the following options to address this:\r\n\r\n1. Keep the code as it is but highlight this specific behavior in the migration docs (and the migration plugin?) to ensure that users are aware and can take appropriate action before the upgrade.\r\n2. Be lenient when we find a matching index template (I'd rather avoid this).\r\n3. Add additional metadata to index templates to store the Elasticsearch version when an index template has been created. Also reimplement the merging logic so we know a setting's origin.\r\n\r\nTo me, option 1 seems the only feasible one (and the doc update is contained in the PR) but I want to put that up for discussion.","created_at":"2016-12-15T18:08:47Z","updated_at":"2017-01-11T18:45:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31781f0748e01dfce0b9b62f83a1e83f01c9788f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/22200/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/22200/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/22200/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/0577acc3eb57824d0266a705595bbcbb5b062454","head":{"label":"danielmitterdorfer:strict-booleans","ref":"strict-booleans","sha":"0577acc3eb57824d0266a705595bbcbb5b062454","user":{"login":"danielmitterdorfer","id":1699576,"avatar_url":"https://avatars.githubusercontent.com/u/1699576?v=3","gravatar_id":"","url":"https://api.github.com/users/danielmitterdorfer","html_url":"https://github.com/danielmitterdorfer","followers_url":"https://api.github.com/users/danielmitterdorfer/followers","following_url":"https://api.github.com/users/danielmitterdorfer/following{/other_user}","gists_url":"https://api.github.com/users/danielmitterdorfer/gists{/gist_id}","starred_url":"https://api.github.com/users/danielmitterdorfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielmitterdorfer/subscriptions","organizations_url":"https://api.github.com/users/danielmitterdorfer/orgs","repos_url":"https://api.github.com/users/danielmitterdorfer/repos","events_url":"https://api.github.com/users/danielmitterdorfer/events{/privacy}","received_events_url":"https://api.github.com/users/danielmitterdorfer/received_events","type":"User","site_admin":false},"repo":{"id":45385894,"name":"elasticsearch","full_name":"danielmitterdorfer/elasticsearch","owner":{"login":"danielmitterdorfer","id":1699576,"avatar_url":"https://avatars.githubusercontent.com/u/1699576?v=3","gravatar_id":"","url":"https://api.github.com/users/danielmitterdorfer","html_url":"https://github.com/danielmitterdorfer","followers_url":"https://api.github.com/users/danielmitterdorfer/followers","following_url":"https://api.github.com/users/danielmitterdorfer/following{/other_user}","gists_url":"https://api.github.com/users/danielmitterdorfer/gists{/gist_id}","starred_url":"https://api.github.com/users/danielmitterdorfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielmitterdorfer/subscriptions","organizations_url":"https://api.github.com/users/danielmitterdorfer/orgs","repos_url":"https://api.github.com/users/danielmitterdorfer/repos","events_url":"https://api.github.com/users/danielmitterdorfer/events{/privacy}","received_events_url":"https://api.github.com/users/danielmitterdorfer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danielmitterdorfer/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch","forks_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/forks","keys_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/teams","hooks_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/events","assignees_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/tags","blobs_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/subscription","commits_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/merges","archive_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/downloads","issues_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/danielmitterdorfer/elasticsearch/deployments","created_at":"2015-11-02T09:51:30Z","updated_at":"2016-07-03T08:20:37Z","pushed_at":"2017-01-10T09:30:15Z","git_url":"git://github.com/danielmitterdorfer/elasticsearch.git","ssh_url":"git@github.com:danielmitterdorfer/elasticsearch.git","clone_url":"https://github.com/danielmitterdorfer/elasticsearch.git","svn_url":"https://github.com/danielmitterdorfer/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":263564,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"72ec3d26610e833617925566b5a74a2dafcd9437","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"name":"elasticsearch","full_name":"elastic/elasticsearch","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elastic/elasticsearch","forks_url":"https://api.github.com/repos/elastic/elasticsearch/forks","keys_url":"https://api.github.com/repos/elastic/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elastic/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/elasticsearch/events","assignees_url":"https://api.github.com/repos/elastic/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elastic/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elastic/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elastic/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elastic/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elastic/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elastic/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/elasticsearch/merges","archive_url":"https://api.github.com/repos/elastic/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elastic/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elastic/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/elasticsearch/deployments","created_at":"2010-02-08T13:20:56Z","updated_at":"2017-01-11T18:33:48Z","pushed_at":"2017-01-11T18:23:28Z","git_url":"git://github.com/elastic/elasticsearch.git","ssh_url":"git@github.com:elastic/elasticsearch.git","clone_url":"https://github.com/elastic/elasticsearch.git","svn_url":"https://github.com/elastic/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":302850,"stargazers_count":20229,"watchers_count":20229,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6958,"mirror_url":null,"open_issues_count":1181,"forks":6958,"open_issues":1181,"watchers":20229,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/22200"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/22200"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/22200"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/22200/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/22200/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/22200/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/0577acc3eb57824d0266a705595bbcbb5b062454"}}}}
{"actor":{"display_login":"nik9000"}}