{"action":"opened","number":1343,"pull_request":{"url":"https://api.github.com/repos/sksamuel/elastic4s/pulls/1343","id":180077948,"html_url":"https://github.com/sksamuel/elastic4s/pull/1343","diff_url":"https://github.com/sksamuel/elastic4s/pull/1343.diff","patch_url":"https://github.com/sksamuel/elastic4s/pull/1343.patch","issue_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/1343","number":1343,"state":"open","locked":false,"title":"Fix join mapping type","user":{"login":"chriso","id":364903,"avatar_url":"https://avatars3.githubusercontent.com/u/364903?v=4","gravatar_id":"","url":"https://api.github.com/users/chriso","html_url":"https://github.com/chriso","followers_url":"https://api.github.com/users/chriso/followers","following_url":"https://api.github.com/users/chriso/following{/other_user}","gists_url":"https://api.github.com/users/chriso/gists{/gist_id}","starred_url":"https://api.github.com/users/chriso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriso/subscriptions","organizations_url":"https://api.github.com/users/chriso/orgs","repos_url":"https://api.github.com/users/chriso/repos","events_url":"https://api.github.com/users/chriso/events{/privacy}","received_events_url":"https://api.github.com/users/chriso/received_events","type":"User","site_admin":false},"body":"This PR includes a fix for https://github.com/sksamuel/elastic4s/pull/1191, and adds support for more than one child per parent.\r\n\r\nAccording to [the docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html), the mapping type should be `join` rather than `object`, and although a mapping may have only one type, the docs say:\r\n\r\n> An element can have multiple children but only one parent.\r\n\r\nFor example:\r\n\r\n```\r\n~ $ curl -X PUT http://localhost:9200/my_index -H 'Content-Type: application/json' \\\r\n    -d '{\"mappings\":{\"_doc\":{\"properties\":{\"type\":{\"type\":\"join\",\"relations\":{\"parent\":[\"child1\",\"child2\"]}}}}}}'\r\n{\"acknowledged\":true,\"shards_acknowledged\":true,\"index\":\"my_index\"}\r\n```\r\n\r\n```\r\n~ $ curl -s http://localhost:9200/my_index | jq                                                                                                                                                 \r\n{\r\n  \"my_index\": {\r\n    \"aliases\": {},\r\n    \"mappings\": {\r\n      \"_doc\": {\r\n        \"properties\": {\r\n          \"type\": {\r\n            \"type\": \"join\",\r\n            \"eager_global_ordinals\": true,\r\n            \"relations\": {\r\n              \"parent\": [\r\n                \"child2\",\r\n                \"child1\"\r\n              ]\r\n            }\r\n          }\r\n        }\r\n      }\r\n    },\r\n    \"settings\": {\r\n      \"index\": {\r\n        \"creation_date\": \"1523059422053\",\r\n        \"number_of_shards\": \"5\",\r\n        \"number_of_replicas\": \"1\",\r\n        \"uuid\": \"WgZ4-v2uRk687w6RY4lGTQ\",\r\n        \"version\": {\r\n          \"created\": \"6020399\"\r\n        },\r\n        \"provided_name\": \"my_index\"\r\n      }\r\n    }\r\n  }\r\n}\r\n```","created_at":"2018-04-07T00:05:00Z","updated_at":"2018-04-07T00:05:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sksamuel/elastic4s/pulls/1343/commits","review_comments_url":"https://api.github.com/repos/sksamuel/elastic4s/pulls/1343/comments","review_comment_url":"https://api.github.com/repos/sksamuel/elastic4s/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/1343/comments","statuses_url":"https://api.github.com/repos/sksamuel/elastic4s/statuses/4daa60a6f20692e6af469a0c9c58fced24bf5bca","head":{"label":"chriso:join-fixes","ref":"join-fixes","sha":"4daa60a6f20692e6af469a0c9c58fced24bf5bca","user":{"login":"chriso","id":364903,"avatar_url":"https://avatars3.githubusercontent.com/u/364903?v=4","gravatar_id":"","url":"https://api.github.com/users/chriso","html_url":"https://github.com/chriso","followers_url":"https://api.github.com/users/chriso/followers","following_url":"https://api.github.com/users/chriso/following{/other_user}","gists_url":"https://api.github.com/users/chriso/gists{/gist_id}","starred_url":"https://api.github.com/users/chriso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriso/subscriptions","organizations_url":"https://api.github.com/users/chriso/orgs","repos_url":"https://api.github.com/users/chriso/repos","events_url":"https://api.github.com/users/chriso/events{/privacy}","received_events_url":"https://api.github.com/users/chriso/received_events","type":"User","site_admin":false},"repo":{"id":128480084,"name":"elastic4s","full_name":"chriso/elastic4s","owner":{"login":"chriso","id":364903,"avatar_url":"https://avatars3.githubusercontent.com/u/364903?v=4","gravatar_id":"","url":"https://api.github.com/users/chriso","html_url":"https://github.com/chriso","followers_url":"https://api.github.com/users/chriso/followers","following_url":"https://api.github.com/users/chriso/following{/other_user}","gists_url":"https://api.github.com/users/chriso/gists{/gist_id}","starred_url":"https://api.github.com/users/chriso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriso/subscriptions","organizations_url":"https://api.github.com/users/chriso/orgs","repos_url":"https://api.github.com/users/chriso/repos","events_url":"https://api.github.com/users/chriso/events{/privacy}","received_events_url":"https://api.github.com/users/chriso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chriso/elastic4s","description":"Elasticsearch Scala Client - Non Blocking, Type Safe, HTTP, REST API, TCP","fork":true,"url":"https://api.github.com/repos/chriso/elastic4s","forks_url":"https://api.github.com/repos/chriso/elastic4s/forks","keys_url":"https://api.github.com/repos/chriso/elastic4s/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chriso/elastic4s/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chriso/elastic4s/teams","hooks_url":"https://api.github.com/repos/chriso/elastic4s/hooks","issue_events_url":"https://api.github.com/repos/chriso/elastic4s/issues/events{/number}","events_url":"https://api.github.com/repos/chriso/elastic4s/events","assignees_url":"https://api.github.com/repos/chriso/elastic4s/assignees{/user}","branches_url":"https://api.github.com/repos/chriso/elastic4s/branches{/branch}","tags_url":"https://api.github.com/repos/chriso/elastic4s/tags","blobs_url":"https://api.github.com/repos/chriso/elastic4s/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chriso/elastic4s/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chriso/elastic4s/git/refs{/sha}","trees_url":"https://api.github.com/repos/chriso/elastic4s/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chriso/elastic4s/statuses/{sha}","languages_url":"https://api.github.com/repos/chriso/elastic4s/languages","stargazers_url":"https://api.github.com/repos/chriso/elastic4s/stargazers","contributors_url":"https://api.github.com/repos/chriso/elastic4s/contributors","subscribers_url":"https://api.github.com/repos/chriso/elastic4s/subscribers","subscription_url":"https://api.github.com/repos/chriso/elastic4s/subscription","commits_url":"https://api.github.com/repos/chriso/elastic4s/commits{/sha}","git_commits_url":"https://api.github.com/repos/chriso/elastic4s/git/commits{/sha}","comments_url":"https://api.github.com/repos/chriso/elastic4s/comments{/number}","issue_comment_url":"https://api.github.com/repos/chriso/elastic4s/issues/comments{/number}","contents_url":"https://api.github.com/repos/chriso/elastic4s/contents/{+path}","compare_url":"https://api.github.com/repos/chriso/elastic4s/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chriso/elastic4s/merges","archive_url":"https://api.github.com/repos/chriso/elastic4s/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chriso/elastic4s/downloads","issues_url":"https://api.github.com/repos/chriso/elastic4s/issues{/number}","pulls_url":"https://api.github.com/repos/chriso/elastic4s/pulls{/number}","milestones_url":"https://api.github.com/repos/chriso/elastic4s/milestones{/number}","notifications_url":"https://api.github.com/repos/chriso/elastic4s/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chriso/elastic4s/labels{/name}","releases_url":"https://api.github.com/repos/chriso/elastic4s/releases{/id}","deployments_url":"https://api.github.com/repos/chriso/elastic4s/deployments","created_at":"2018-04-06T23:31:06Z","updated_at":"2018-04-06T23:31:10Z","pushed_at":"2018-04-07T00:02:03Z","git_url":"git://github.com/chriso/elastic4s.git","ssh_url":"git@github.com:chriso/elastic4s.git","clone_url":"https://github.com/chriso/elastic4s.git","svn_url":"https://github.com/chriso/elastic4s","homepage":"","size":9160,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sksamuel:master","ref":"master","sha":"7329c314d8249d6c2e1f5d6501eaef3d09cb5138","user":{"login":"sksamuel","id":743706,"avatar_url":"https://avatars3.githubusercontent.com/u/743706?v=4","gravatar_id":"","url":"https://api.github.com/users/sksamuel","html_url":"https://github.com/sksamuel","followers_url":"https://api.github.com/users/sksamuel/followers","following_url":"https://api.github.com/users/sksamuel/following{/other_user}","gists_url":"https://api.github.com/users/sksamuel/gists{/gist_id}","starred_url":"https://api.github.com/users/sksamuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sksamuel/subscriptions","organizations_url":"https://api.github.com/users/sksamuel/orgs","repos_url":"https://api.github.com/users/sksamuel/repos","events_url":"https://api.github.com/users/sksamuel/events{/privacy}","received_events_url":"https://api.github.com/users/sksamuel/received_events","type":"User","site_admin":false},"repo":{"id":10608695,"name":"elastic4s","full_name":"sksamuel/elastic4s","owner":{"login":"sksamuel","id":743706,"avatar_url":"https://avatars3.githubusercontent.com/u/743706?v=4","gravatar_id":"","url":"https://api.github.com/users/sksamuel","html_url":"https://github.com/sksamuel","followers_url":"https://api.github.com/users/sksamuel/followers","following_url":"https://api.github.com/users/sksamuel/following{/other_user}","gists_url":"https://api.github.com/users/sksamuel/gists{/gist_id}","starred_url":"https://api.github.com/users/sksamuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sksamuel/subscriptions","organizations_url":"https://api.github.com/users/sksamuel/orgs","repos_url":"https://api.github.com/users/sksamuel/repos","events_url":"https://api.github.com/users/sksamuel/events{/privacy}","received_events_url":"https://api.github.com/users/sksamuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sksamuel/elastic4s","description":"Elasticsearch Scala Client - Non Blocking, Type Safe, HTTP, REST API, TCP","fork":false,"url":"https://api.github.com/repos/sksamuel/elastic4s","forks_url":"https://api.github.com/repos/sksamuel/elastic4s/forks","keys_url":"https://api.github.com/repos/sksamuel/elastic4s/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sksamuel/elastic4s/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sksamuel/elastic4s/teams","hooks_url":"https://api.github.com/repos/sksamuel/elastic4s/hooks","issue_events_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/events{/number}","events_url":"https://api.github.com/repos/sksamuel/elastic4s/events","assignees_url":"https://api.github.com/repos/sksamuel/elastic4s/assignees{/user}","branches_url":"https://api.github.com/repos/sksamuel/elastic4s/branches{/branch}","tags_url":"https://api.github.com/repos/sksamuel/elastic4s/tags","blobs_url":"https://api.github.com/repos/sksamuel/elastic4s/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sksamuel/elastic4s/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sksamuel/elastic4s/git/refs{/sha}","trees_url":"https://api.github.com/repos/sksamuel/elastic4s/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sksamuel/elastic4s/statuses/{sha}","languages_url":"https://api.github.com/repos/sksamuel/elastic4s/languages","stargazers_url":"https://api.github.com/repos/sksamuel/elastic4s/stargazers","contributors_url":"https://api.github.com/repos/sksamuel/elastic4s/contributors","subscribers_url":"https://api.github.com/repos/sksamuel/elastic4s/subscribers","subscription_url":"https://api.github.com/repos/sksamuel/elastic4s/subscription","commits_url":"https://api.github.com/repos/sksamuel/elastic4s/commits{/sha}","git_commits_url":"https://api.github.com/repos/sksamuel/elastic4s/git/commits{/sha}","comments_url":"https://api.github.com/repos/sksamuel/elastic4s/comments{/number}","issue_comment_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/comments{/number}","contents_url":"https://api.github.com/repos/sksamuel/elastic4s/contents/{+path}","compare_url":"https://api.github.com/repos/sksamuel/elastic4s/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sksamuel/elastic4s/merges","archive_url":"https://api.github.com/repos/sksamuel/elastic4s/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sksamuel/elastic4s/downloads","issues_url":"https://api.github.com/repos/sksamuel/elastic4s/issues{/number}","pulls_url":"https://api.github.com/repos/sksamuel/elastic4s/pulls{/number}","milestones_url":"https://api.github.com/repos/sksamuel/elastic4s/milestones{/number}","notifications_url":"https://api.github.com/repos/sksamuel/elastic4s/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sksamuel/elastic4s/labels{/name}","releases_url":"https://api.github.com/repos/sksamuel/elastic4s/releases{/id}","deployments_url":"https://api.github.com/repos/sksamuel/elastic4s/deployments","created_at":"2013-06-10T20:23:57Z","updated_at":"2018-04-05T10:52:06Z","pushed_at":"2018-04-05T11:43:16Z","git_url":"git://github.com/sksamuel/elastic4s.git","ssh_url":"git@github.com:sksamuel/elastic4s.git","clone_url":"https://github.com/sksamuel/elastic4s.git","svn_url":"https://github.com/sksamuel/elastic4s","homepage":"","size":9160,"stargazers_count":1131,"watchers_count":1131,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":445,"mirror_url":null,"archived":false,"open_issues_count":39,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":445,"open_issues":39,"watchers":1131,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sksamuel/elastic4s/pulls/1343"},"html":{"href":"https://github.com/sksamuel/elastic4s/pull/1343"},"issue":{"href":"https://api.github.com/repos/sksamuel/elastic4s/issues/1343"},"comments":{"href":"https://api.github.com/repos/sksamuel/elastic4s/issues/1343/comments"},"review_comments":{"href":"https://api.github.com/repos/sksamuel/elastic4s/pulls/1343/comments"},"review_comment":{"href":"https://api.github.com/repos/sksamuel/elastic4s/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sksamuel/elastic4s/pulls/1343/commits"},"statuses":{"href":"https://api.github.com/repos/sksamuel/elastic4s/statuses/4daa60a6f20692e6af469a0c9c58fced24bf5bca"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":4,"additions":13,"deletions":5,"changed_files":3}}
{"actor":{"display_login":"chriso"}}