{"action":"created","comment":{"url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/pulls/comments/56800427","id":56800427,"diff_hunk":"@@ -45,6 +46,23 @@ def match(self, record):\n         return self.query.accept(MatchUnit(record))\n \n \n+def get_affected_records(spec=None, search_pattern=None):\n+    \"\"\"Get list of affected records.\"\"\"\n+    sets = '_oai.sets:{0}'.format(spec) if spec else None\n+    search_pattern = search_pattern if search_pattern else None\n+\n+    query = \" OR \".join(filter(None, [sets, search_pattern]))\n+    body = {'query': Query(query).query.accept(ElasticSearchDSL())}\n+\n+    response = current_search_client.search(","path":"invenio_oaiserver/query.py","position":20,"original_position":20,"commit_id":"26a53dcd79458e924744f7341c60e529196a83b8","original_commit_id":"040f1bf98d61c0cb6fbc9102f4c093c4a2c059f8","user":{"login":"hachreak","id":377047,"avatar_url":"https://avatars.githubusercontent.com/u/377047?v=3","gravatar_id":"","url":"https://api.github.com/users/hachreak","html_url":"https://github.com/hachreak","followers_url":"https://api.github.com/users/hachreak/followers","following_url":"https://api.github.com/users/hachreak/following{/other_user}","gists_url":"https://api.github.com/users/hachreak/gists{/gist_id}","starred_url":"https://api.github.com/users/hachreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hachreak/subscriptions","organizations_url":"https://api.github.com/users/hachreak/orgs","repos_url":"https://api.github.com/users/hachreak/repos","events_url":"https://api.github.com/users/hachreak/events{/privacy}","received_events_url":"https://api.github.com/users/hachreak/received_events","type":"User","site_admin":false},"body":"It comes from `elasticsearch.helpers`, are you sure that insert a direct dependency of `elasticsearch-py` here is a good idea? Can I access from `invenio-search`?","created_at":"2016-03-21T10:07:50Z","updated_at":"2016-03-21T10:07:50Z","html_url":"https://github.com/inveniosoftware/invenio-oaiserver/pull/16#discussion_r56800427","pull_request_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/pulls/comments/56800427"},"html":{"href":"https://github.com/inveniosoftware/invenio-oaiserver/pull/16#discussion_r56800427"},"pull_request":{"href":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/pulls/16","id":58912852,"html_url":"https://github.com/inveniosoftware/invenio-oaiserver/pull/16","diff_url":"https://github.com/inveniosoftware/invenio-oaiserver/pull/16.diff","patch_url":"https://github.com/inveniosoftware/invenio-oaiserver/pull/16.patch","issue_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/issues/16","number":16,"state":"open","locked":false,"title":"receivers: update record after set change","user":{"login":"hachreak","id":377047,"avatar_url":"https://avatars.githubusercontent.com/u/377047?v=3","gravatar_id":"","url":"https://api.github.com/users/hachreak","html_url":"https://github.com/hachreak","followers_url":"https://api.github.com/users/hachreak/followers","following_url":"https://api.github.com/users/hachreak/following{/other_user}","gists_url":"https://api.github.com/users/hachreak/gists{/gist_id}","starred_url":"https://api.github.com/users/hachreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hachreak/subscriptions","organizations_url":"https://api.github.com/users/hachreak/orgs","repos_url":"https://api.github.com/users/hachreak/repos","events_url":"https://api.github.com/users/hachreak/events{/privacy}","received_events_url":"https://api.github.com/users/hachreak/received_events","type":"User","site_admin":false},"body":"Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>","created_at":"2016-02-10T16:13:00Z","updated_at":"2016-03-21T10:07:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"766afdbacb992a78c91c1f14856d0fd8107b4d52","assignee":{"login":"jirikuncar","id":189798,"avatar_url":"https://avatars.githubusercontent.com/u/189798?v=3","gravatar_id":"","url":"https://api.github.com/users/jirikuncar","html_url":"https://github.com/jirikuncar","followers_url":"https://api.github.com/users/jirikuncar/followers","following_url":"https://api.github.com/users/jirikuncar/following{/other_user}","gists_url":"https://api.github.com/users/jirikuncar/gists{/gist_id}","starred_url":"https://api.github.com/users/jirikuncar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jirikuncar/subscriptions","organizations_url":"https://api.github.com/users/jirikuncar/orgs","repos_url":"https://api.github.com/users/jirikuncar/repos","events_url":"https://api.github.com/users/jirikuncar/events{/privacy}","received_events_url":"https://api.github.com/users/jirikuncar/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/milestones/2","html_url":"https://github.com/inveniosoftware/invenio-oaiserver/milestones/Sprint-OAIServer","labels_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/milestones/2/labels","id":1644897,"number":2,"title":"Sprint-OAIServer","description":"","creator":{"login":"lnielsen","id":1698163,"avatar_url":"https://avatars.githubusercontent.com/u/1698163?v=3","gravatar_id":"","url":"https://api.github.com/users/lnielsen","html_url":"https://github.com/lnielsen","followers_url":"https://api.github.com/users/lnielsen/followers","following_url":"https://api.github.com/users/lnielsen/following{/other_user}","gists_url":"https://api.github.com/users/lnielsen/gists{/gist_id}","starred_url":"https://api.github.com/users/lnielsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lnielsen/subscriptions","organizations_url":"https://api.github.com/users/lnielsen/orgs","repos_url":"https://api.github.com/users/lnielsen/repos","events_url":"https://api.github.com/users/lnielsen/events{/privacy}","received_events_url":"https://api.github.com/users/lnielsen/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":12,"state":"open","created_at":"2016-03-15T07:32:51Z","updated_at":"2016-03-21T09:36:56Z","due_on":"2016-03-23T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/pulls/16/commits","review_comments_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/pulls/16/comments","review_comment_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/issues/16/comments","statuses_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/statuses/26a53dcd79458e924744f7341c60e529196a83b8","head":{"label":"hachreak:group_oai_information_in_record","ref":"group_oai_information_in_record","sha":"26a53dcd79458e924744f7341c60e529196a83b8","user":{"login":"hachreak","id":377047,"avatar_url":"https://avatars.githubusercontent.com/u/377047?v=3","gravatar_id":"","url":"https://api.github.com/users/hachreak","html_url":"https://github.com/hachreak","followers_url":"https://api.github.com/users/hachreak/followers","following_url":"https://api.github.com/users/hachreak/following{/other_user}","gists_url":"https://api.github.com/users/hachreak/gists{/gist_id}","starred_url":"https://api.github.com/users/hachreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hachreak/subscriptions","organizations_url":"https://api.github.com/users/hachreak/orgs","repos_url":"https://api.github.com/users/hachreak/repos","events_url":"https://api.github.com/users/hachreak/events{/privacy}","received_events_url":"https://api.github.com/users/hachreak/received_events","type":"User","site_admin":false},"repo":{"id":51288088,"name":"invenio-oaiserver","full_name":"hachreak/invenio-oaiserver","owner":{"login":"hachreak","id":377047,"avatar_url":"https://avatars.githubusercontent.com/u/377047?v=3","gravatar_id":"","url":"https://api.github.com/users/hachreak","html_url":"https://github.com/hachreak","followers_url":"https://api.github.com/users/hachreak/followers","following_url":"https://api.github.com/users/hachreak/following{/other_user}","gists_url":"https://api.github.com/users/hachreak/gists{/gist_id}","starred_url":"https://api.github.com/users/hachreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hachreak/subscriptions","organizations_url":"https://api.github.com/users/hachreak/orgs","repos_url":"https://api.github.com/users/hachreak/repos","events_url":"https://api.github.com/users/hachreak/events{/privacy}","received_events_url":"https://api.github.com/users/hachreak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hachreak/invenio-oaiserver","description":"Invenio OAI Repository (placeholder for history)","fork":true,"url":"https://api.github.com/repos/hachreak/invenio-oaiserver","forks_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/forks","keys_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/teams","hooks_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/hooks","issue_events_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/issues/events{/number}","events_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/events","assignees_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/assignees{/user}","branches_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/branches{/branch}","tags_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/tags","blobs_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/statuses/{sha}","languages_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/languages","stargazers_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/stargazers","contributors_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/contributors","subscribers_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/subscribers","subscription_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/subscription","commits_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/contents/{+path}","compare_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/merges","archive_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/downloads","issues_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/issues{/number}","pulls_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/pulls{/number}","milestones_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/milestones{/number}","notifications_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/labels{/name}","releases_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/releases{/id}","deployments_url":"https://api.github.com/repos/hachreak/invenio-oaiserver/deployments","created_at":"2016-02-08T09:11:56Z","updated_at":"2016-02-08T09:11:57Z","pushed_at":"2016-03-21T09:49:29Z","git_url":"git://github.com/hachreak/invenio-oaiserver.git","ssh_url":"git@github.com:hachreak/invenio-oaiserver.git","clone_url":"https://github.com/hachreak/invenio-oaiserver.git","svn_url":"https://github.com/hachreak/invenio-oaiserver","homepage":"","size":185,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"inveniosoftware:master","ref":"master","sha":"469a79959fed14f19a6edafd84ad0ca95518a193","user":{"login":"inveniosoftware","id":1157480,"avatar_url":"https://avatars.githubusercontent.com/u/1157480?v=3","gravatar_id":"","url":"https://api.github.com/users/inveniosoftware","html_url":"https://github.com/inveniosoftware","followers_url":"https://api.github.com/users/inveniosoftware/followers","following_url":"https://api.github.com/users/inveniosoftware/following{/other_user}","gists_url":"https://api.github.com/users/inveniosoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/inveniosoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inveniosoftware/subscriptions","organizations_url":"https://api.github.com/users/inveniosoftware/orgs","repos_url":"https://api.github.com/users/inveniosoftware/repos","events_url":"https://api.github.com/users/inveniosoftware/events{/privacy}","received_events_url":"https://api.github.com/users/inveniosoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":40709093,"name":"invenio-oaiserver","full_name":"inveniosoftware/invenio-oaiserver","owner":{"login":"inveniosoftware","id":1157480,"avatar_url":"https://avatars.githubusercontent.com/u/1157480?v=3","gravatar_id":"","url":"https://api.github.com/users/inveniosoftware","html_url":"https://github.com/inveniosoftware","followers_url":"https://api.github.com/users/inveniosoftware/followers","following_url":"https://api.github.com/users/inveniosoftware/following{/other_user}","gists_url":"https://api.github.com/users/inveniosoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/inveniosoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inveniosoftware/subscriptions","organizations_url":"https://api.github.com/users/inveniosoftware/orgs","repos_url":"https://api.github.com/users/inveniosoftware/repos","events_url":"https://api.github.com/users/inveniosoftware/events{/privacy}","received_events_url":"https://api.github.com/users/inveniosoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/inveniosoftware/invenio-oaiserver","description":"Invenio module that adds more fun to the platform.","fork":false,"url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver","forks_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/forks","keys_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/teams","hooks_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/hooks","issue_events_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/issues/events{/number}","events_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/events","assignees_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/assignees{/user}","branches_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/branches{/branch}","tags_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/tags","blobs_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/statuses/{sha}","languages_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/languages","stargazers_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/stargazers","contributors_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/contributors","subscribers_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/subscribers","subscription_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/subscription","commits_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/contents/{+path}","compare_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/merges","archive_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/downloads","issues_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/issues{/number}","pulls_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/pulls{/number}","milestones_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/milestones{/number}","notifications_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/labels{/name}","releases_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/releases{/id}","deployments_url":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/deployments","created_at":"2015-08-14T10:12:18Z","updated_at":"2016-02-10T08:51:20Z","pushed_at":"2016-03-21T09:49:29Z","git_url":"git://github.com/inveniosoftware/invenio-oaiserver.git","ssh_url":"git@github.com:inveniosoftware/invenio-oaiserver.git","clone_url":"https://github.com/inveniosoftware/invenio-oaiserver.git","svn_url":"https://github.com/inveniosoftware/invenio-oaiserver","homepage":"","size":227,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":8,"forks":5,"open_issues":8,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/pulls/16"},"html":{"href":"https://github.com/inveniosoftware/invenio-oaiserver/pull/16"},"issue":{"href":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/issues/16"},"comments":{"href":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/inveniosoftware/invenio-oaiserver/statuses/26a53dcd79458e924744f7341c60e529196a83b8"}}}}