{"action":"created","comment":{"url":"https://api.github.com/repos/inveniosoftware/invenio/pulls/comments/27857374","id":27857374,"diff_hunk":"@@ -139,9 +141,15 @@ def get_facets_for_query(self, qid, limit=20, parent=None):\n         \"\"\"Return facet data.\"\"\"\n         from invenio.legacy.search_engine import get_most_popular_field_values,\\\n             get_field_tags\n-        return get_most_popular_field_values(self.get_recids(qid),\n-                                             get_field_tags(self.name)\n-                                             )[0:limit]\n+        most_popular_fields = get_most_popular_field_values(\n+            self.get_recids(qid), get_field_tags(self.name))[0:limit]\n+        most_popular_fields = map(lambda x: {","path":"invenio/modules/search/facet_builders.py","position":65,"original_position":65,"commit_id":"2fbb5f38f8649d52fb7b22bb2e4953e9283f33c3","original_commit_id":"2fbb5f38f8649d52fb7b22bb2e4953e9283f33c3","user":{"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},"body":"- [ ] please use Python list comprehension (more effective)\r\n- [ ] it would be nice to make the structure as similar to Elastic Search as possible where it makes sense (see http://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-aggregations-bucket-nested-aggregation.html) ","created_at":"2015-04-07T07:50:42Z","updated_at":"2015-04-07T07:50:42Z","html_url":"https://github.com/inveniosoftware/invenio/pull/2752#discussion_r27857374","pull_request_url":"https://api.github.com/repos/inveniosoftware/invenio/pulls/2752","_links":{"self":{"href":"https://api.github.com/repos/inveniosoftware/invenio/pulls/comments/27857374"},"html":{"href":"https://github.com/inveniosoftware/invenio/pull/2752#discussion_r27857374"},"pull_request":{"href":"https://api.github.com/repos/inveniosoftware/invenio/pulls/2752"}}},"pull_request":{"url":"https://api.github.com/repos/inveniosoftware/invenio/pulls/2752","id":28815114,"html_url":"https://github.com/inveniosoftware/invenio/pull/2752","diff_url":"https://github.com/inveniosoftware/invenio/pull/2752.diff","patch_url":"https://github.com/inveniosoftware/invenio/pull/2752.patch","issue_url":"https://api.github.com/repos/inveniosoftware/invenio/issues/2752","number":2752,"state":"open","locked":false,"title":"search: final facets and jasmine tests","user":{"login":"jacquerie","id":381280,"avatar_url":"https://avatars.githubusercontent.com/u/381280?v=3","gravatar_id":"","url":"https://api.github.com/users/jacquerie","html_url":"https://github.com/jacquerie","followers_url":"https://api.github.com/users/jacquerie/followers","following_url":"https://api.github.com/users/jacquerie/following{/other_user}","gists_url":"https://api.github.com/users/jacquerie/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquerie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquerie/subscriptions","organizations_url":"https://api.github.com/users/jacquerie/orgs","repos_url":"https://api.github.com/users/jacquerie/repos","events_url":"https://api.github.com/users/jacquerie/events{/privacy}","received_events_url":"https://api.github.com/users/jacquerie/received_events","type":"User","site_admin":false},"body":"Here's the rebased version of #2281 on top of the current pu branch. Jasmine-Ajax changed major version since, therefore I updated the tests (and the required version).\r\n\r\nTests are green and functionality seems to be there.\r\n\r\n(CC: @lnielsen @jalavik @jmartinm @kaplun) ","created_at":"2015-02-06T15:11:08Z","updated_at":"2015-04-07T07:50:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5c5f2902052ef28b65ce7391faaaf9626cb2543","assignee":null,"milestone":{"url":"https://api.github.com/repos/inveniosoftware/invenio/milestones/13","html_url":"https://github.com/inveniosoftware/invenio/milestones/v2.1","labels_url":"https://api.github.com/repos/inveniosoftware/invenio/milestones/13/labels","id":857114,"number":13,"title":"v2.1","description":"","creator":{"login":"tiborsimko","id":517546,"avatar_url":"https://avatars.githubusercontent.com/u/517546?v=3","gravatar_id":"","url":"https://api.github.com/users/tiborsimko","html_url":"https://github.com/tiborsimko","followers_url":"https://api.github.com/users/tiborsimko/followers","following_url":"https://api.github.com/users/tiborsimko/following{/other_user}","gists_url":"https://api.github.com/users/tiborsimko/gists{/gist_id}","starred_url":"https://api.github.com/users/tiborsimko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiborsimko/subscriptions","organizations_url":"https://api.github.com/users/tiborsimko/orgs","repos_url":"https://api.github.com/users/tiborsimko/repos","events_url":"https://api.github.com/users/tiborsimko/events{/privacy}","received_events_url":"https://api.github.com/users/tiborsimko/received_events","type":"User","site_admin":false},"open_issues":84,"closed_issues":51,"state":"open","created_at":"2014-11-07T09:21:23Z","updated_at":"2015-04-06T22:38:53Z","due_on":"2015-04-30T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/inveniosoftware/invenio/pulls/2752/commits","review_comments_url":"https://api.github.com/repos/inveniosoftware/invenio/pulls/2752/comments","review_comment_url":"https://api.github.com/repos/inveniosoftware/invenio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/inveniosoftware/invenio/issues/2752/comments","statuses_url":"https://api.github.com/repos/inveniosoftware/invenio/statuses/2fbb5f38f8649d52fb7b22bb2e4953e9283f33c3","head":{"label":"jacquerie:kneczaj-rebase-and-update","ref":"kneczaj-rebase-and-update","sha":"2fbb5f38f8649d52fb7b22bb2e4953e9283f33c3","user":{"login":"jacquerie","id":381280,"avatar_url":"https://avatars.githubusercontent.com/u/381280?v=3","gravatar_id":"","url":"https://api.github.com/users/jacquerie","html_url":"https://github.com/jacquerie","followers_url":"https://api.github.com/users/jacquerie/followers","following_url":"https://api.github.com/users/jacquerie/following{/other_user}","gists_url":"https://api.github.com/users/jacquerie/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquerie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquerie/subscriptions","organizations_url":"https://api.github.com/users/jacquerie/orgs","repos_url":"https://api.github.com/users/jacquerie/repos","events_url":"https://api.github.com/users/jacquerie/events{/privacy}","received_events_url":"https://api.github.com/users/jacquerie/received_events","type":"User","site_admin":false},"repo":{"id":30291666,"name":"invenio","full_name":"jacquerie/invenio","owner":{"login":"jacquerie","id":381280,"avatar_url":"https://avatars.githubusercontent.com/u/381280?v=3","gravatar_id":"","url":"https://api.github.com/users/jacquerie","html_url":"https://github.com/jacquerie","followers_url":"https://api.github.com/users/jacquerie/followers","following_url":"https://api.github.com/users/jacquerie/following{/other_user}","gists_url":"https://api.github.com/users/jacquerie/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquerie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquerie/subscriptions","organizations_url":"https://api.github.com/users/jacquerie/orgs","repos_url":"https://api.github.com/users/jacquerie/repos","events_url":"https://api.github.com/users/jacquerie/events{/privacy}","received_events_url":"https://api.github.com/users/jacquerie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jacquerie/invenio","description":"Invenio digital library software","fork":true,"url":"https://api.github.com/repos/jacquerie/invenio","forks_url":"https://api.github.com/repos/jacquerie/invenio/forks","keys_url":"https://api.github.com/repos/jacquerie/invenio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacquerie/invenio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacquerie/invenio/teams","hooks_url":"https://api.github.com/repos/jacquerie/invenio/hooks","issue_events_url":"https://api.github.com/repos/jacquerie/invenio/issues/events{/number}","events_url":"https://api.github.com/repos/jacquerie/invenio/events","assignees_url":"https://api.github.com/repos/jacquerie/invenio/assignees{/user}","branches_url":"https://api.github.com/repos/jacquerie/invenio/branches{/branch}","tags_url":"https://api.github.com/repos/jacquerie/invenio/tags","blobs_url":"https://api.github.com/repos/jacquerie/invenio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacquerie/invenio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacquerie/invenio/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacquerie/invenio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacquerie/invenio/statuses/{sha}","languages_url":"https://api.github.com/repos/jacquerie/invenio/languages","stargazers_url":"https://api.github.com/repos/jacquerie/invenio/stargazers","contributors_url":"https://api.github.com/repos/jacquerie/invenio/contributors","subscribers_url":"https://api.github.com/repos/jacquerie/invenio/subscribers","subscription_url":"https://api.github.com/repos/jacquerie/invenio/subscription","commits_url":"https://api.github.com/repos/jacquerie/invenio/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacquerie/invenio/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacquerie/invenio/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacquerie/invenio/issues/comments{/number}","contents_url":"https://api.github.com/repos/jacquerie/invenio/contents/{+path}","compare_url":"https://api.github.com/repos/jacquerie/invenio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacquerie/invenio/merges","archive_url":"https://api.github.com/repos/jacquerie/invenio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacquerie/invenio/downloads","issues_url":"https://api.github.com/repos/jacquerie/invenio/issues{/number}","pulls_url":"https://api.github.com/repos/jacquerie/invenio/pulls{/number}","milestones_url":"https://api.github.com/repos/jacquerie/invenio/milestones{/number}","notifications_url":"https://api.github.com/repos/jacquerie/invenio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacquerie/invenio/labels{/name}","releases_url":"https://api.github.com/repos/jacquerie/invenio/releases{/id}","created_at":"2015-02-04T09:38:21Z","updated_at":"2015-02-16T13:20:51Z","pushed_at":"2015-04-01T16:07:24Z","git_url":"git://github.com/jacquerie/invenio.git","ssh_url":"git@github.com:jacquerie/invenio.git","clone_url":"https://github.com/jacquerie/invenio.git","svn_url":"https://github.com/jacquerie/invenio","homepage":"http://invenio-software.org/","size":80709,"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":"pu"}},"base":{"label":"inveniosoftware:pu","ref":"pu","sha":"08379b569ee1d493a73ae9e3a1a0f1b4bbf02e5b","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":2665618,"name":"invenio","full_name":"inveniosoftware/invenio","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","description":"Invenio digital library software","fork":false,"url":"https://api.github.com/repos/inveniosoftware/invenio","forks_url":"https://api.github.com/repos/inveniosoftware/invenio/forks","keys_url":"https://api.github.com/repos/inveniosoftware/invenio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inveniosoftware/invenio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inveniosoftware/invenio/teams","hooks_url":"https://api.github.com/repos/inveniosoftware/invenio/hooks","issue_events_url":"https://api.github.com/repos/inveniosoftware/invenio/issues/events{/number}","events_url":"https://api.github.com/repos/inveniosoftware/invenio/events","assignees_url":"https://api.github.com/repos/inveniosoftware/invenio/assignees{/user}","branches_url":"https://api.github.com/repos/inveniosoftware/invenio/branches{/branch}","tags_url":"https://api.github.com/repos/inveniosoftware/invenio/tags","blobs_url":"https://api.github.com/repos/inveniosoftware/invenio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inveniosoftware/invenio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inveniosoftware/invenio/git/refs{/sha}","trees_url":"https://api.github.com/repos/inveniosoftware/invenio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inveniosoftware/invenio/statuses/{sha}","languages_url":"https://api.github.com/repos/inveniosoftware/invenio/languages","stargazers_url":"https://api.github.com/repos/inveniosoftware/invenio/stargazers","contributors_url":"https://api.github.com/repos/inveniosoftware/invenio/contributors","subscribers_url":"https://api.github.com/repos/inveniosoftware/invenio/subscribers","subscription_url":"https://api.github.com/repos/inveniosoftware/invenio/subscription","commits_url":"https://api.github.com/repos/inveniosoftware/invenio/commits{/sha}","git_commits_url":"https://api.github.com/repos/inveniosoftware/invenio/git/commits{/sha}","comments_url":"https://api.github.com/repos/inveniosoftware/invenio/comments{/number}","issue_comment_url":"https://api.github.com/repos/inveniosoftware/invenio/issues/comments{/number}","contents_url":"https://api.github.com/repos/inveniosoftware/invenio/contents/{+path}","compare_url":"https://api.github.com/repos/inveniosoftware/invenio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inveniosoftware/invenio/merges","archive_url":"https://api.github.com/repos/inveniosoftware/invenio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inveniosoftware/invenio/downloads","issues_url":"https://api.github.com/repos/inveniosoftware/invenio/issues{/number}","pulls_url":"https://api.github.com/repos/inveniosoftware/invenio/pulls{/number}","milestones_url":"https://api.github.com/repos/inveniosoftware/invenio/milestones{/number}","notifications_url":"https://api.github.com/repos/inveniosoftware/invenio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inveniosoftware/invenio/labels{/name}","releases_url":"https://api.github.com/repos/inveniosoftware/invenio/releases{/id}","created_at":"2011-10-28T14:33:51Z","updated_at":"2015-04-05T23:31:51Z","pushed_at":"2015-04-04T14:47:28Z","git_url":"git://github.com/inveniosoftware/invenio.git","ssh_url":"git@github.com:inveniosoftware/invenio.git","clone_url":"https://github.com/inveniosoftware/invenio.git","svn_url":"https://github.com/inveniosoftware/invenio","homepage":"http://invenio-software.org/","size":98381,"stargazers_count":54,"watchers_count":54,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":116,"mirror_url":null,"open_issues_count":813,"forks":116,"open_issues":813,"watchers":54,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/inveniosoftware/invenio/pulls/2752"},"html":{"href":"https://github.com/inveniosoftware/invenio/pull/2752"},"issue":{"href":"https://api.github.com/repos/inveniosoftware/invenio/issues/2752"},"comments":{"href":"https://api.github.com/repos/inveniosoftware/invenio/issues/2752/comments"},"review_comments":{"href":"https://api.github.com/repos/inveniosoftware/invenio/pulls/2752/comments"},"review_comment":{"href":"https://api.github.com/repos/inveniosoftware/invenio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/inveniosoftware/invenio/pulls/2752/commits"},"statuses":{"href":"https://api.github.com/repos/inveniosoftware/invenio/statuses/2fbb5f38f8649d52fb7b22bb2e4953e9283f33c3"}}}}