{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/77786848","id":77786848,"diff_hunk":"@@ -84,6 +86,19 @@ public DiscountedCumulativeGainAt(int position) {\n     }\n \n     /**\n+     * @param position number of top results to check against a given set of relevant results. Must be positive.\n+     *  // TODO is there a way to enforce this?\n+     * @param normalize If set to true, dcg will be normalized (ndcg)\n+     * See https://en.wikipedia.org/wiki/Discounted_cumulative_gain\n+     * @param unknownDocRating the rating for docs the user hasn't supplied an explicit rating for\n+     * */\n+    public DiscountedCumulativeGainAt(int position, boolean normalize, Integer unknownDocRating) {","path":"modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/DiscountedCumulativeGainAt.java","position":29,"original_position":29,"commit_id":"1d69a943be282abdc309d8b81466fb62193d0584","original_commit_id":"1d69a943be282abdc309d8b81466fb62193d0584","user":{"login":"MaineC","id":70953,"avatar_url":"https://avatars.githubusercontent.com/u/70953?v=3","gravatar_id":"","url":"https://api.github.com/users/MaineC","html_url":"https://github.com/MaineC","followers_url":"https://api.github.com/users/MaineC/followers","following_url":"https://api.github.com/users/MaineC/following{/other_user}","gists_url":"https://api.github.com/users/MaineC/gists{/gist_id}","starred_url":"https://api.github.com/users/MaineC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaineC/subscriptions","organizations_url":"https://api.github.com/users/MaineC/orgs","repos_url":"https://api.github.com/users/MaineC/repos","events_url":"https://api.github.com/users/MaineC/events{/privacy}","received_events_url":"https://api.github.com/users/MaineC/received_events","type":"User","site_admin":false},"body":"+1 (especially after realising how I missed one of those after your comment above).","created_at":"2016-09-07T09:18:21Z","updated_at":"2016-09-07T09:18:21Z","html_url":"https://github.com/elastic/elasticsearch/pull/20140#discussion_r77786848","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/20140","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/77786848"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/20140#discussion_r77786848"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/20140"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/20140","id":82533866,"html_url":"https://github.com/elastic/elasticsearch/pull/20140","diff_url":"https://github.com/elastic/elasticsearch/pull/20140.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/20140.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/20140","number":20140,"state":"open","locked":false,"title":"Add roundtrip xcontent testx","user":{"login":"MaineC","id":70953,"avatar_url":"https://avatars.githubusercontent.com/u/70953?v=3","gravatar_id":"","url":"https://api.github.com/users/MaineC","html_url":"https://github.com/MaineC","followers_url":"https://api.github.com/users/MaineC/followers","following_url":"https://api.github.com/users/MaineC/following{/other_user}","gists_url":"https://api.github.com/users/MaineC/gists{/gist_id}","starred_url":"https://api.github.com/users/MaineC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaineC/subscriptions","organizations_url":"https://api.github.com/users/MaineC/orgs","repos_url":"https://api.github.com/users/MaineC/repos","events_url":"https://api.github.com/users/MaineC/events{/privacy}","received_events_url":"https://api.github.com/users/MaineC/received_events","type":"User","site_admin":false},"body":"This factors the roundtripping out of RatedDocumentTests. Makes\r\nRankedListQualityMetric and RatedDocument implement FromXContenBuilder\r\nto be able to do the aforementioned refactoring in a generic way. Adds\r\na roundtrip test to DiscountedCumulativeGainAt.\r\n\r\n\r\nOpen questions:\r\n\r\nDiscountedCumulativeGain didn't have a constructor that accepted all possible\r\nparameters as arguments. Added one. I guess we still want to keep the one\r\nthat only requires the position argument?\r\n\r\nTo make roundtripping work I had to change the NAME parameter when generating\r\nXContent for DiscountedCumulativeGainAt - all remaining unit tests seem to be\r\npassing (haven't checked the REST tests yet) - need to figure out why that was\r\nthere to begin with.\r\n\r\n\r\nOpen TODOs:\r\n\r\nAdd the same roundtripping to all other classes that support to-/fromXContent","created_at":"2016-08-24T12:35:56Z","updated_at":"2016-09-07T09:18:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0fb1a5ba982f6fc88a2ae0ccfbb91b30d2fa7e32","assignee":{"login":"cbuescher","id":10398885,"avatar_url":"https://avatars.githubusercontent.com/u/10398885?v=3","gravatar_id":"","url":"https://api.github.com/users/cbuescher","html_url":"https://github.com/cbuescher","followers_url":"https://api.github.com/users/cbuescher/followers","following_url":"https://api.github.com/users/cbuescher/following{/other_user}","gists_url":"https://api.github.com/users/cbuescher/gists{/gist_id}","starred_url":"https://api.github.com/users/cbuescher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbuescher/subscriptions","organizations_url":"https://api.github.com/users/cbuescher/orgs","repos_url":"https://api.github.com/users/cbuescher/repos","events_url":"https://api.github.com/users/cbuescher/events{/privacy}","received_events_url":"https://api.github.com/users/cbuescher/received_events","type":"User","site_admin":false},"assignees":[{"login":"cbuescher","id":10398885,"avatar_url":"https://avatars.githubusercontent.com/u/10398885?v=3","gravatar_id":"","url":"https://api.github.com/users/cbuescher","html_url":"https://github.com/cbuescher","followers_url":"https://api.github.com/users/cbuescher/followers","following_url":"https://api.github.com/users/cbuescher/following{/other_user}","gists_url":"https://api.github.com/users/cbuescher/gists{/gist_id}","starred_url":"https://api.github.com/users/cbuescher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbuescher/subscriptions","organizations_url":"https://api.github.com/users/cbuescher/orgs","repos_url":"https://api.github.com/users/cbuescher/repos","events_url":"https://api.github.com/users/cbuescher/events{/privacy}","received_events_url":"https://api.github.com/users/cbuescher/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/20140/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/20140/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/20140/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/1d69a943be282abdc309d8b81466fb62193d0584","head":{"label":"MaineC:feature/rank-eval-roundtrip-testing","ref":"feature/rank-eval-roundtrip-testing","sha":"1d69a943be282abdc309d8b81466fb62193d0584","user":{"login":"MaineC","id":70953,"avatar_url":"https://avatars.githubusercontent.com/u/70953?v=3","gravatar_id":"","url":"https://api.github.com/users/MaineC","html_url":"https://github.com/MaineC","followers_url":"https://api.github.com/users/MaineC/followers","following_url":"https://api.github.com/users/MaineC/following{/other_user}","gists_url":"https://api.github.com/users/MaineC/gists{/gist_id}","starred_url":"https://api.github.com/users/MaineC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaineC/subscriptions","organizations_url":"https://api.github.com/users/MaineC/orgs","repos_url":"https://api.github.com/users/MaineC/repos","events_url":"https://api.github.com/users/MaineC/events{/privacy}","received_events_url":"https://api.github.com/users/MaineC/received_events","type":"User","site_admin":false},"repo":{"id":14859176,"name":"elasticsearch","full_name":"MaineC/elasticsearch","owner":{"login":"MaineC","id":70953,"avatar_url":"https://avatars.githubusercontent.com/u/70953?v=3","gravatar_id":"","url":"https://api.github.com/users/MaineC","html_url":"https://github.com/MaineC","followers_url":"https://api.github.com/users/MaineC/followers","following_url":"https://api.github.com/users/MaineC/following{/other_user}","gists_url":"https://api.github.com/users/MaineC/gists{/gist_id}","starred_url":"https://api.github.com/users/MaineC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaineC/subscriptions","organizations_url":"https://api.github.com/users/MaineC/orgs","repos_url":"https://api.github.com/users/MaineC/repos","events_url":"https://api.github.com/users/MaineC/events{/privacy}","received_events_url":"https://api.github.com/users/MaineC/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MaineC/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/MaineC/elasticsearch","forks_url":"https://api.github.com/repos/MaineC/elasticsearch/forks","keys_url":"https://api.github.com/repos/MaineC/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MaineC/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MaineC/elasticsearch/teams","hooks_url":"https://api.github.com/repos/MaineC/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/MaineC/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/MaineC/elasticsearch/events","assignees_url":"https://api.github.com/repos/MaineC/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/MaineC/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/MaineC/elasticsearch/tags","blobs_url":"https://api.github.com/repos/MaineC/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MaineC/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MaineC/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/MaineC/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MaineC/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/MaineC/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/MaineC/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/MaineC/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/MaineC/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/MaineC/elasticsearch/subscription","commits_url":"https://api.github.com/repos/MaineC/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/MaineC/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/MaineC/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/MaineC/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/MaineC/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/MaineC/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MaineC/elasticsearch/merges","archive_url":"https://api.github.com/repos/MaineC/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MaineC/elasticsearch/downloads","issues_url":"https://api.github.com/repos/MaineC/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/MaineC/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/MaineC/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/MaineC/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MaineC/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/MaineC/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/MaineC/elasticsearch/deployments","created_at":"2013-12-02T10:17:35Z","updated_at":"2015-05-06T09:43:46Z","pushed_at":"2016-08-25T10:14:45Z","git_url":"git://github.com/MaineC/elasticsearch.git","ssh_url":"git@github.com:MaineC/elasticsearch.git","clone_url":"https://github.com/MaineC/elasticsearch.git","svn_url":"https://github.com/MaineC/elasticsearch","homepage":"http://elasticsearch.org","size":207141,"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:feature/rank-eval","ref":"feature/rank-eval","sha":"518e09d028b4e9b76235e7c09bb2dea8fff88a9c","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":"2016-09-07T07:31:42Z","pushed_at":"2016-09-07T09:00:03Z","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":345845,"stargazers_count":18291,"watchers_count":18291,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6226,"mirror_url":null,"open_issues_count":1141,"forks":6226,"open_issues":1141,"watchers":18291,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/20140"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/20140"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/20140"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/20140/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/20140/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/20140/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/1d69a943be282abdc309d8b81466fb62193d0584"}}}}
{"actor":{"display_login":"MaineC"}}