{"action":"created","comment":{"url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/pulls/comments/85661317","pull_request_review_id":6365024,"id":85661317,"diff_hunk":"@@ -0,0 +1,55 @@\n+class ApplicantsIndex < Chewy::Index\n+  define_type User.applicant.includes(:job_types, :educations, :skills, :user_profile) do\n+    witchcraft!\n+    field :id, type: \"integer\", value: -> {id}\n+    field :name, value: -> {name}\n+    field :email, value: -> {email}\n+    field :address, value: -> {address}\n+    field :job_types, value: -> {job_types.pluck :name}\n+    field :schools, value: -> {educations.pluck :school}\n+    field :skills, value: -> {skills.pluck :name}\n+    field :position, value: -> {user_profile.current_position if user_profile}\n+  end\n+\n+  class << self\n+    def suggest_to_applicant applicant\n+      query(bool: {\n+        must_not: [\n+          {match: {id: applicant.id}},\n+          {terms: {id: applicant.followeds.pluck(:followed_id)}}\n+        ],\n+        should: [\n+          {match: {\n+            address: {\n+              query: applicant.address,\n+              boost: 6\n+            }\n+          }},\n+          {match: {\n+            schools: {\n+              query: applicant.educations.pluck(:school).join(\" \"),\n+              boost: 5\n+            }\n+          }},\n+          {match: {job_types: applicant.job_types.pluck(:name).join(\" \")}},\n+          {match: {skills: applicant.skills.pluck(:name).join(\" \")}},\n+          {match: {position: applicant.user_profile ? applicant.user_profile.current_position : \"\"}}","path":"app/chewy/applicants_index.rb","position":36,"original_position":36,"commit_id":"92b600311cdde7ec9a17ae20574c9b221831ea4e","original_commit_id":"92b600311cdde7ec9a17ae20574c9b221831ea4e","user":{"login":"NgengChhengkim","id":9549149,"avatar_url":"https://avatars.githubusercontent.com/u/9549149?v=3","gravatar_id":"","url":"https://api.github.com/users/NgengChhengkim","html_url":"https://github.com/NgengChhengkim","followers_url":"https://api.github.com/users/NgengChhengkim/followers","following_url":"https://api.github.com/users/NgengChhengkim/following{/other_user}","gists_url":"https://api.github.com/users/NgengChhengkim/gists{/gist_id}","starred_url":"https://api.github.com/users/NgengChhengkim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NgengChhengkim/subscriptions","organizations_url":"https://api.github.com/users/NgengChhengkim/orgs","repos_url":"https://api.github.com/users/NgengChhengkim/repos","events_url":"https://api.github.com/users/NgengChhengkim/events{/privacy}","received_events_url":"https://api.github.com/users/NgengChhengkim/received_events","type":"User","site_admin":false},"body":"yong tang lakhan position teat?","created_at":"2016-10-30T14:48:14Z","updated_at":"2016-10-30T14:48:14Z","html_url":"https://github.com/yongsokhengkhmer/ruby-thesis/pull/35#discussion_r85661317","pull_request_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/pulls/comments/85661317"},"html":{"href":"https://github.com/yongsokhengkhmer/ruby-thesis/pull/35#discussion_r85661317"},"pull_request":{"href":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/pulls/35","id":90850070,"html_url":"https://github.com/yongsokhengkhmer/ruby-thesis/pull/35","diff_url":"https://github.com/yongsokhengkhmer/ruby-thesis/pull/35.diff","patch_url":"https://github.com/yongsokhengkhmer/ruby-thesis/pull/35.patch","issue_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/issues/35","number":35,"state":"open","locked":false,"title":"Suggest people to applicant/recruiter","user":{"login":"yongsokheng","id":9548057,"avatar_url":"https://avatars.githubusercontent.com/u/9548057?v=3","gravatar_id":"","url":"https://api.github.com/users/yongsokheng","html_url":"https://github.com/yongsokheng","followers_url":"https://api.github.com/users/yongsokheng/followers","following_url":"https://api.github.com/users/yongsokheng/following{/other_user}","gists_url":"https://api.github.com/users/yongsokheng/gists{/gist_id}","starred_url":"https://api.github.com/users/yongsokheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongsokheng/subscriptions","organizations_url":"https://api.github.com/users/yongsokheng/orgs","repos_url":"https://api.github.com/users/yongsokheng/repos","events_url":"https://api.github.com/users/yongsokheng/events{/privacy}","received_events_url":"https://api.github.com/users/yongsokheng/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-25T17:05:23Z","updated_at":"2016-10-30T14:48:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f010002ef8d57a201788144cb3329c2e72b8c23d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/pulls/35/commits","review_comments_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/pulls/35/comments","review_comment_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/issues/35/comments","statuses_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/statuses/92b600311cdde7ec9a17ae20574c9b221831ea4e","head":{"label":"yongsokheng:suggest_recruiter_to_applicant","ref":"suggest_recruiter_to_applicant","sha":"92b600311cdde7ec9a17ae20574c9b221831ea4e","user":{"login":"yongsokheng","id":9548057,"avatar_url":"https://avatars.githubusercontent.com/u/9548057?v=3","gravatar_id":"","url":"https://api.github.com/users/yongsokheng","html_url":"https://github.com/yongsokheng","followers_url":"https://api.github.com/users/yongsokheng/followers","following_url":"https://api.github.com/users/yongsokheng/following{/other_user}","gists_url":"https://api.github.com/users/yongsokheng/gists{/gist_id}","starred_url":"https://api.github.com/users/yongsokheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongsokheng/subscriptions","organizations_url":"https://api.github.com/users/yongsokheng/orgs","repos_url":"https://api.github.com/users/yongsokheng/repos","events_url":"https://api.github.com/users/yongsokheng/events{/privacy}","received_events_url":"https://api.github.com/users/yongsokheng/received_events","type":"User","site_admin":false},"repo":{"id":68723754,"name":"ruby-thesis","full_name":"yongsokheng/ruby-thesis","owner":{"login":"yongsokheng","id":9548057,"avatar_url":"https://avatars.githubusercontent.com/u/9548057?v=3","gravatar_id":"","url":"https://api.github.com/users/yongsokheng","html_url":"https://github.com/yongsokheng","followers_url":"https://api.github.com/users/yongsokheng/followers","following_url":"https://api.github.com/users/yongsokheng/following{/other_user}","gists_url":"https://api.github.com/users/yongsokheng/gists{/gist_id}","starred_url":"https://api.github.com/users/yongsokheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongsokheng/subscriptions","organizations_url":"https://api.github.com/users/yongsokheng/orgs","repos_url":"https://api.github.com/users/yongsokheng/repos","events_url":"https://api.github.com/users/yongsokheng/events{/privacy}","received_events_url":"https://api.github.com/users/yongsokheng/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yongsokheng/ruby-thesis","description":null,"fork":true,"url":"https://api.github.com/repos/yongsokheng/ruby-thesis","forks_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/forks","keys_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/teams","hooks_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/hooks","issue_events_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/issues/events{/number}","events_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/events","assignees_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/assignees{/user}","branches_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/branches{/branch}","tags_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/tags","blobs_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/git/refs{/sha}","trees_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/statuses/{sha}","languages_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/languages","stargazers_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/stargazers","contributors_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/contributors","subscribers_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/subscribers","subscription_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/subscription","commits_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/commits{/sha}","git_commits_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/git/commits{/sha}","comments_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/comments{/number}","issue_comment_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/issues/comments{/number}","contents_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/contents/{+path}","compare_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/merges","archive_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/downloads","issues_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/issues{/number}","pulls_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/pulls{/number}","milestones_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/milestones{/number}","notifications_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/labels{/name}","releases_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/releases{/id}","deployments_url":"https://api.github.com/repos/yongsokheng/ruby-thesis/deployments","created_at":"2016-09-20T15:04:15Z","updated_at":"2016-09-20T14:56:19Z","pushed_at":"2016-10-30T08:30:47Z","git_url":"git://github.com/yongsokheng/ruby-thesis.git","ssh_url":"git@github.com:yongsokheng/ruby-thesis.git","clone_url":"https://github.com/yongsokheng/ruby-thesis.git","svn_url":"https://github.com/yongsokheng/ruby-thesis","homepage":null,"size":186,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"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":"yongsokhengkhmer:develop","ref":"develop","sha":"8c79915fa9461d90934978325da670768fa0ba40","user":{"login":"yongsokhengkhmer","id":22322413,"avatar_url":"https://avatars.githubusercontent.com/u/22322413?v=3","gravatar_id":"","url":"https://api.github.com/users/yongsokhengkhmer","html_url":"https://github.com/yongsokhengkhmer","followers_url":"https://api.github.com/users/yongsokhengkhmer/followers","following_url":"https://api.github.com/users/yongsokhengkhmer/following{/other_user}","gists_url":"https://api.github.com/users/yongsokhengkhmer/gists{/gist_id}","starred_url":"https://api.github.com/users/yongsokhengkhmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongsokhengkhmer/subscriptions","organizations_url":"https://api.github.com/users/yongsokhengkhmer/orgs","repos_url":"https://api.github.com/users/yongsokhengkhmer/repos","events_url":"https://api.github.com/users/yongsokhengkhmer/events{/privacy}","received_events_url":"https://api.github.com/users/yongsokhengkhmer/received_events","type":"User","site_admin":false},"repo":{"id":68723040,"name":"ruby-thesis","full_name":"yongsokhengkhmer/ruby-thesis","owner":{"login":"yongsokhengkhmer","id":22322413,"avatar_url":"https://avatars.githubusercontent.com/u/22322413?v=3","gravatar_id":"","url":"https://api.github.com/users/yongsokhengkhmer","html_url":"https://github.com/yongsokhengkhmer","followers_url":"https://api.github.com/users/yongsokhengkhmer/followers","following_url":"https://api.github.com/users/yongsokhengkhmer/following{/other_user}","gists_url":"https://api.github.com/users/yongsokhengkhmer/gists{/gist_id}","starred_url":"https://api.github.com/users/yongsokhengkhmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongsokhengkhmer/subscriptions","organizations_url":"https://api.github.com/users/yongsokhengkhmer/orgs","repos_url":"https://api.github.com/users/yongsokhengkhmer/repos","events_url":"https://api.github.com/users/yongsokhengkhmer/events{/privacy}","received_events_url":"https://api.github.com/users/yongsokhengkhmer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yongsokhengkhmer/ruby-thesis","description":null,"fork":false,"url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis","forks_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/forks","keys_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/teams","hooks_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/hooks","issue_events_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/issues/events{/number}","events_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/events","assignees_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/assignees{/user}","branches_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/branches{/branch}","tags_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/tags","blobs_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/git/refs{/sha}","trees_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/statuses/{sha}","languages_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/languages","stargazers_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/stargazers","contributors_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/contributors","subscribers_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/subscribers","subscription_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/subscription","commits_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/commits{/sha}","git_commits_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/git/commits{/sha}","comments_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/comments{/number}","issue_comment_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/issues/comments{/number}","contents_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/contents/{+path}","compare_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/merges","archive_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/downloads","issues_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/issues{/number}","pulls_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/pulls{/number}","milestones_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/milestones{/number}","notifications_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/labels{/name}","releases_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/releases{/id}","deployments_url":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/deployments","created_at":"2016-09-20T14:56:19Z","updated_at":"2016-10-18T14:16:45Z","pushed_at":"2016-10-30T08:30:48Z","git_url":"git://github.com/yongsokhengkhmer/ruby-thesis.git","ssh_url":"git@github.com:yongsokhengkhmer/ruby-thesis.git","clone_url":"https://github.com/yongsokhengkhmer/ruby-thesis.git","svn_url":"https://github.com/yongsokhengkhmer/ruby-thesis","homepage":null,"size":177,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/pulls/35"},"html":{"href":"https://github.com/yongsokhengkhmer/ruby-thesis/pull/35"},"issue":{"href":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/issues/35"},"comments":{"href":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/yongsokhengkhmer/ruby-thesis/statuses/92b600311cdde7ec9a17ae20574c9b221831ea4e"}}}}
{"actor":{"display_login":"NgengChhengkim"}}