{"action":"created","comment":{"url":"https://api.github.com/repos/DOAJ/doaj/pulls/comments/34504196","id":34504196,"diff_hunk":"@@ -140,16 +184,35 @@ def search_journals(cls, q, page, page_size):\n             raise DiscoveryException(\"There was an error executing your query\")\n \n         obs = [models.Journal(**raw) for raw in esprit.raw.unpack_json_result(res)]\n-        return cls._make_response(res, q, page, page_size, obs)\n+        return cls._make_response(res, q, page, page_size, sort, obs)\n+\n+    @classmethod\n+    def search_applications(cls, account, q, page, page_size, sort=None):\n+        search_subs = app.config.get(\"DISCOVERY_APPLICATION_SEARCH_SUBS\", {})\n+        sort_subs = app.config.get(\"DISCOVERY_APPLICATION_SORT_SUBS\", {})\n+        query, page, page_size = cls._make_application_query(account, q, page, page_size, sort, search_subs, sort_subs)\n+\n+        # execute the query against the articles\n+        res = models.Suggestion.query(q=query.query(), consistent_order=False)\n+\n+        # check to see if there was a search error\n+        if res.get(\"error\") is not None:\n+            app.logger.error(\"Error executing discovery query search: {x}\".format(x=res.get(\"error\")))","path":"portality/api/v1/discovery.py","position":140,"original_position":140,"commit_id":"1696849df87f3e3b4485813a3aaabe611572bf8f","original_commit_id":"1696849df87f3e3b4485813a3aaabe611572bf8f","user":{"login":"richard-jones","id":856138,"avatar_url":"https://avatars.githubusercontent.com/u/856138?v=3","gravatar_id":"","url":"https://api.github.com/users/richard-jones","html_url":"https://github.com/richard-jones","followers_url":"https://api.github.com/users/richard-jones/followers","following_url":"https://api.github.com/users/richard-jones/following{/other_user}","gists_url":"https://api.github.com/users/richard-jones/gists{/gist_id}","starred_url":"https://api.github.com/users/richard-jones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richard-jones/subscriptions","organizations_url":"https://api.github.com/users/richard-jones/orgs","repos_url":"https://api.github.com/users/richard-jones/repos","events_url":"https://api.github.com/users/richard-jones/events{/privacy}","received_events_url":"https://api.github.com/users/richard-jones/received_events","type":"User","site_admin":false},"body":"Ok, sounds like a good idea, will add","created_at":"2015-07-13T19:55:18Z","updated_at":"2015-07-13T19:55:18Z","html_url":"https://github.com/DOAJ/doaj/pull/806#discussion_r34504196","pull_request_url":"https://api.github.com/repos/DOAJ/doaj/pulls/806","_links":{"self":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/comments/34504196"},"html":{"href":"https://github.com/DOAJ/doaj/pull/806#discussion_r34504196"},"pull_request":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/806"}}},"pull_request":{"url":"https://api.github.com/repos/DOAJ/doaj/pulls/806","id":39805465,"html_url":"https://github.com/DOAJ/doaj/pull/806","diff_url":"https://github.com/DOAJ/doaj/pull/806.diff","patch_url":"https://github.com/DOAJ/doaj/pull/806.patch","issue_url":"https://api.github.com/repos/DOAJ/doaj/issues/806","number":806,"state":"open","locked":false,"title":"Feature/751 application discovery","user":{"login":"richard-jones","id":856138,"avatar_url":"https://avatars.githubusercontent.com/u/856138?v=3","gravatar_id":"","url":"https://api.github.com/users/richard-jones","html_url":"https://github.com/richard-jones","followers_url":"https://api.github.com/users/richard-jones/followers","following_url":"https://api.github.com/users/richard-jones/following{/other_user}","gists_url":"https://api.github.com/users/richard-jones/gists{/gist_id}","starred_url":"https://api.github.com/users/richard-jones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richard-jones/subscriptions","organizations_url":"https://api.github.com/users/richard-jones/orgs","repos_url":"https://api.github.com/users/richard-jones/repos","events_url":"https://api.github.com/users/richard-jones/events{/privacy}","received_events_url":"https://api.github.com/users/richard-jones/received_events","type":"User","site_admin":false},"body":"Contains the following features:\r\n\r\n* sort ability on all api endpoints\r\n* jsonp responses to all requests (including errors)\r\n* authenticated application search","created_at":"2015-07-13T12:17:28Z","updated_at":"2015-07-13T19:55:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5753827086736c8e9bcd8f010ebb07abbcae498d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DOAJ/doaj/pulls/806/commits","review_comments_url":"https://api.github.com/repos/DOAJ/doaj/pulls/806/comments","review_comment_url":"https://api.github.com/repos/DOAJ/doaj/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DOAJ/doaj/issues/806/comments","statuses_url":"https://api.github.com/repos/DOAJ/doaj/statuses/1696849df87f3e3b4485813a3aaabe611572bf8f","head":{"label":"DOAJ:feature/751_application_discovery","ref":"feature/751_application_discovery","sha":"1696849df87f3e3b4485813a3aaabe611572bf8f","user":{"login":"DOAJ","id":5971926,"avatar_url":"https://avatars.githubusercontent.com/u/5971926?v=3","gravatar_id":"","url":"https://api.github.com/users/DOAJ","html_url":"https://github.com/DOAJ","followers_url":"https://api.github.com/users/DOAJ/followers","following_url":"https://api.github.com/users/DOAJ/following{/other_user}","gists_url":"https://api.github.com/users/DOAJ/gists{/gist_id}","starred_url":"https://api.github.com/users/DOAJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DOAJ/subscriptions","organizations_url":"https://api.github.com/users/DOAJ/orgs","repos_url":"https://api.github.com/users/DOAJ/repos","events_url":"https://api.github.com/users/DOAJ/events{/privacy}","received_events_url":"https://api.github.com/users/DOAJ/received_events","type":"Organization","site_admin":false},"repo":{"id":14500626,"name":"doaj","full_name":"DOAJ/doaj","owner":{"login":"DOAJ","id":5971926,"avatar_url":"https://avatars.githubusercontent.com/u/5971926?v=3","gravatar_id":"","url":"https://api.github.com/users/DOAJ","html_url":"https://github.com/DOAJ","followers_url":"https://api.github.com/users/DOAJ/followers","following_url":"https://api.github.com/users/DOAJ/following{/other_user}","gists_url":"https://api.github.com/users/DOAJ/gists{/gist_id}","starred_url":"https://api.github.com/users/DOAJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DOAJ/subscriptions","organizations_url":"https://api.github.com/users/DOAJ/orgs","repos_url":"https://api.github.com/users/DOAJ/repos","events_url":"https://api.github.com/users/DOAJ/events{/privacy}","received_events_url":"https://api.github.com/users/DOAJ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DOAJ/doaj","description":"The Directory of Open Access Journals - website and directory software","fork":false,"url":"https://api.github.com/repos/DOAJ/doaj","forks_url":"https://api.github.com/repos/DOAJ/doaj/forks","keys_url":"https://api.github.com/repos/DOAJ/doaj/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DOAJ/doaj/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DOAJ/doaj/teams","hooks_url":"https://api.github.com/repos/DOAJ/doaj/hooks","issue_events_url":"https://api.github.com/repos/DOAJ/doaj/issues/events{/number}","events_url":"https://api.github.com/repos/DOAJ/doaj/events","assignees_url":"https://api.github.com/repos/DOAJ/doaj/assignees{/user}","branches_url":"https://api.github.com/repos/DOAJ/doaj/branches{/branch}","tags_url":"https://api.github.com/repos/DOAJ/doaj/tags","blobs_url":"https://api.github.com/repos/DOAJ/doaj/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DOAJ/doaj/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DOAJ/doaj/git/refs{/sha}","trees_url":"https://api.github.com/repos/DOAJ/doaj/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DOAJ/doaj/statuses/{sha}","languages_url":"https://api.github.com/repos/DOAJ/doaj/languages","stargazers_url":"https://api.github.com/repos/DOAJ/doaj/stargazers","contributors_url":"https://api.github.com/repos/DOAJ/doaj/contributors","subscribers_url":"https://api.github.com/repos/DOAJ/doaj/subscribers","subscription_url":"https://api.github.com/repos/DOAJ/doaj/subscription","commits_url":"https://api.github.com/repos/DOAJ/doaj/commits{/sha}","git_commits_url":"https://api.github.com/repos/DOAJ/doaj/git/commits{/sha}","comments_url":"https://api.github.com/repos/DOAJ/doaj/comments{/number}","issue_comment_url":"https://api.github.com/repos/DOAJ/doaj/issues/comments{/number}","contents_url":"https://api.github.com/repos/DOAJ/doaj/contents/{+path}","compare_url":"https://api.github.com/repos/DOAJ/doaj/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DOAJ/doaj/merges","archive_url":"https://api.github.com/repos/DOAJ/doaj/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DOAJ/doaj/downloads","issues_url":"https://api.github.com/repos/DOAJ/doaj/issues{/number}","pulls_url":"https://api.github.com/repos/DOAJ/doaj/pulls{/number}","milestones_url":"https://api.github.com/repos/DOAJ/doaj/milestones{/number}","notifications_url":"https://api.github.com/repos/DOAJ/doaj/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DOAJ/doaj/labels{/name}","releases_url":"https://api.github.com/repos/DOAJ/doaj/releases{/id}","created_at":"2013-11-18T18:07:31Z","updated_at":"2015-06-03T03:16:30Z","pushed_at":"2015-07-13T19:29:38Z","git_url":"git://github.com/DOAJ/doaj.git","ssh_url":"git@github.com:DOAJ/doaj.git","clone_url":"https://github.com/DOAJ/doaj.git","svn_url":"https://github.com/DOAJ/doaj","homepage":null,"size":9857,"stargazers_count":5,"watchers_count":5,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":133,"forks":1,"open_issues":133,"watchers":5,"default_branch":"develop"}},"base":{"label":"DOAJ:develop","ref":"develop","sha":"d84d0513a2f493fdeaa425365cc857b5517b3277","user":{"login":"DOAJ","id":5971926,"avatar_url":"https://avatars.githubusercontent.com/u/5971926?v=3","gravatar_id":"","url":"https://api.github.com/users/DOAJ","html_url":"https://github.com/DOAJ","followers_url":"https://api.github.com/users/DOAJ/followers","following_url":"https://api.github.com/users/DOAJ/following{/other_user}","gists_url":"https://api.github.com/users/DOAJ/gists{/gist_id}","starred_url":"https://api.github.com/users/DOAJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DOAJ/subscriptions","organizations_url":"https://api.github.com/users/DOAJ/orgs","repos_url":"https://api.github.com/users/DOAJ/repos","events_url":"https://api.github.com/users/DOAJ/events{/privacy}","received_events_url":"https://api.github.com/users/DOAJ/received_events","type":"Organization","site_admin":false},"repo":{"id":14500626,"name":"doaj","full_name":"DOAJ/doaj","owner":{"login":"DOAJ","id":5971926,"avatar_url":"https://avatars.githubusercontent.com/u/5971926?v=3","gravatar_id":"","url":"https://api.github.com/users/DOAJ","html_url":"https://github.com/DOAJ","followers_url":"https://api.github.com/users/DOAJ/followers","following_url":"https://api.github.com/users/DOAJ/following{/other_user}","gists_url":"https://api.github.com/users/DOAJ/gists{/gist_id}","starred_url":"https://api.github.com/users/DOAJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DOAJ/subscriptions","organizations_url":"https://api.github.com/users/DOAJ/orgs","repos_url":"https://api.github.com/users/DOAJ/repos","events_url":"https://api.github.com/users/DOAJ/events{/privacy}","received_events_url":"https://api.github.com/users/DOAJ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DOAJ/doaj","description":"The Directory of Open Access Journals - website and directory software","fork":false,"url":"https://api.github.com/repos/DOAJ/doaj","forks_url":"https://api.github.com/repos/DOAJ/doaj/forks","keys_url":"https://api.github.com/repos/DOAJ/doaj/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DOAJ/doaj/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DOAJ/doaj/teams","hooks_url":"https://api.github.com/repos/DOAJ/doaj/hooks","issue_events_url":"https://api.github.com/repos/DOAJ/doaj/issues/events{/number}","events_url":"https://api.github.com/repos/DOAJ/doaj/events","assignees_url":"https://api.github.com/repos/DOAJ/doaj/assignees{/user}","branches_url":"https://api.github.com/repos/DOAJ/doaj/branches{/branch}","tags_url":"https://api.github.com/repos/DOAJ/doaj/tags","blobs_url":"https://api.github.com/repos/DOAJ/doaj/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DOAJ/doaj/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DOAJ/doaj/git/refs{/sha}","trees_url":"https://api.github.com/repos/DOAJ/doaj/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DOAJ/doaj/statuses/{sha}","languages_url":"https://api.github.com/repos/DOAJ/doaj/languages","stargazers_url":"https://api.github.com/repos/DOAJ/doaj/stargazers","contributors_url":"https://api.github.com/repos/DOAJ/doaj/contributors","subscribers_url":"https://api.github.com/repos/DOAJ/doaj/subscribers","subscription_url":"https://api.github.com/repos/DOAJ/doaj/subscription","commits_url":"https://api.github.com/repos/DOAJ/doaj/commits{/sha}","git_commits_url":"https://api.github.com/repos/DOAJ/doaj/git/commits{/sha}","comments_url":"https://api.github.com/repos/DOAJ/doaj/comments{/number}","issue_comment_url":"https://api.github.com/repos/DOAJ/doaj/issues/comments{/number}","contents_url":"https://api.github.com/repos/DOAJ/doaj/contents/{+path}","compare_url":"https://api.github.com/repos/DOAJ/doaj/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DOAJ/doaj/merges","archive_url":"https://api.github.com/repos/DOAJ/doaj/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DOAJ/doaj/downloads","issues_url":"https://api.github.com/repos/DOAJ/doaj/issues{/number}","pulls_url":"https://api.github.com/repos/DOAJ/doaj/pulls{/number}","milestones_url":"https://api.github.com/repos/DOAJ/doaj/milestones{/number}","notifications_url":"https://api.github.com/repos/DOAJ/doaj/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DOAJ/doaj/labels{/name}","releases_url":"https://api.github.com/repos/DOAJ/doaj/releases{/id}","created_at":"2013-11-18T18:07:31Z","updated_at":"2015-06-03T03:16:30Z","pushed_at":"2015-07-13T19:29:38Z","git_url":"git://github.com/DOAJ/doaj.git","ssh_url":"git@github.com:DOAJ/doaj.git","clone_url":"https://github.com/DOAJ/doaj.git","svn_url":"https://github.com/DOAJ/doaj","homepage":null,"size":9857,"stargazers_count":5,"watchers_count":5,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":133,"forks":1,"open_issues":133,"watchers":5,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/806"},"html":{"href":"https://github.com/DOAJ/doaj/pull/806"},"issue":{"href":"https://api.github.com/repos/DOAJ/doaj/issues/806"},"comments":{"href":"https://api.github.com/repos/DOAJ/doaj/issues/806/comments"},"review_comments":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/806/comments"},"review_comment":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/806/commits"},"statuses":{"href":"https://api.github.com/repos/DOAJ/doaj/statuses/1696849df87f3e3b4485813a3aaabe611572bf8f"}}}}