{"action":"created","comment":{"url":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/comments/32637530","id":32637530,"diff_hunk":"@@ -0,0 +1,78 @@\n+package org.atlasapi.query.common;\n+\n+import org.atlasapi.content.IndexQueryParams;\n+import org.atlasapi.content.QueryOrdering;\n+import org.atlasapi.content.FuzzyQueryParams;\n+\n+import java.util.Map;\n+import java.util.Optional;\n+\n+\n+/***\n+    This is more or less a hack to allow parsing simple query params off of a HTTP request param map,\n+    found on a {@link Query}. It should be removed and replaced once a refactor of Deer's query\n+    parsing allows this sort of thing to be done easier and in a more general fashion.\n+ */\n+public class IndexQueryParser {\n+\n+    public IndexQueryParams parse(Query<?> query) throws QueryParseException {\n+        return new IndexQueryParams(\n+                titleQueryFrom(query),\n+                orderingFrom(query)\n+        );\n+    }\n+\n+    private Optional<QueryOrdering> orderingFrom(Query<?> query) throws QueryParseException {\n+        Map params = query.getContext().getRequest().getParameterMap();\n+        if (!params.containsKey(\"order_by\")) {\n+            return Optional.empty();\n+        }\n+        String[] orderByVals = ((String[]) params.get(\"order_by\"));\n+        if (orderByVals[0] == null) {","path":"atlas-api/src/main/java/org/atlasapi/query/common/IndexQueryParser.java","position":31,"original_position":31,"commit_id":"0af1af8ea3b1c63c33a54cdf54023d9ffabdf663","original_commit_id":"0af1af8ea3b1c63c33a54cdf54023d9ffabdf663","user":{"login":"tsprlng","id":547676,"avatar_url":"https://avatars.githubusercontent.com/u/547676?v=3","gravatar_id":"","url":"https://api.github.com/users/tsprlng","html_url":"https://github.com/tsprlng","followers_url":"https://api.github.com/users/tsprlng/followers","following_url":"https://api.github.com/users/tsprlng/following{/other_user}","gists_url":"https://api.github.com/users/tsprlng/gists{/gist_id}","starred_url":"https://api.github.com/users/tsprlng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsprlng/subscriptions","organizations_url":"https://api.github.com/users/tsprlng/orgs","repos_url":"https://api.github.com/users/tsprlng/repos","events_url":"https://api.github.com/users/tsprlng/events{/privacy}","received_events_url":"https://api.github.com/users/tsprlng/received_events","type":"User","site_admin":false},"body":"Iterables.getOnlyOne","created_at":"2015-06-17T15:15:12Z","updated_at":"2015-06-17T15:15:12Z","html_url":"https://github.com/atlasapi/atlas-deer/pull/102#discussion_r32637530","pull_request_url":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/102","_links":{"self":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/comments/32637530"},"html":{"href":"https://github.com/atlasapi/atlas-deer/pull/102#discussion_r32637530"},"pull_request":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/102"}}},"pull_request":{"url":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/102","id":37911291,"html_url":"https://github.com/atlasapi/atlas-deer/pull/102","diff_url":"https://github.com/atlasapi/atlas-deer/pull/102.diff","patch_url":"https://github.com/atlasapi/atlas-deer/pull/102.patch","issue_url":"https://api.github.com/repos/atlasapi/atlas-deer/issues/102","number":102,"state":"open","locked":false,"title":"Mbst 11643 ingest priority add to model and search index","user":{"login":"mbst-jamie","id":8318871,"avatar_url":"https://avatars.githubusercontent.com/u/8318871?v=3","gravatar_id":"","url":"https://api.github.com/users/mbst-jamie","html_url":"https://github.com/mbst-jamie","followers_url":"https://api.github.com/users/mbst-jamie/followers","following_url":"https://api.github.com/users/mbst-jamie/following{/other_user}","gists_url":"https://api.github.com/users/mbst-jamie/gists{/gist_id}","starred_url":"https://api.github.com/users/mbst-jamie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbst-jamie/subscriptions","organizations_url":"https://api.github.com/users/mbst-jamie/orgs","repos_url":"https://api.github.com/users/mbst-jamie/repos","events_url":"https://api.github.com/users/mbst-jamie/events{/privacy}","received_events_url":"https://api.github.com/users/mbst-jamie/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-17T15:08:42Z","updated_at":"2015-06-17T15:15:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b71b68fc17c497fea19a05ab2b77b2907306f560","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/102/commits","review_comments_url":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/102/comments","review_comment_url":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/atlasapi/atlas-deer/issues/102/comments","statuses_url":"https://api.github.com/repos/atlasapi/atlas-deer/statuses/0af1af8ea3b1c63c33a54cdf54023d9ffabdf663","head":{"label":"atlasapi:mbst-11643-ingest-priority-add-to-model-and-search-index","ref":"mbst-11643-ingest-priority-add-to-model-and-search-index","sha":"0af1af8ea3b1c63c33a54cdf54023d9ffabdf663","user":{"login":"atlasapi","id":325129,"avatar_url":"https://avatars.githubusercontent.com/u/325129?v=3","gravatar_id":"","url":"https://api.github.com/users/atlasapi","html_url":"https://github.com/atlasapi","followers_url":"https://api.github.com/users/atlasapi/followers","following_url":"https://api.github.com/users/atlasapi/following{/other_user}","gists_url":"https://api.github.com/users/atlasapi/gists{/gist_id}","starred_url":"https://api.github.com/users/atlasapi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atlasapi/subscriptions","organizations_url":"https://api.github.com/users/atlasapi/orgs","repos_url":"https://api.github.com/users/atlasapi/repos","events_url":"https://api.github.com/users/atlasapi/events{/privacy}","received_events_url":"https://api.github.com/users/atlasapi/received_events","type":"Organization","site_admin":false},"repo":{"id":14117583,"name":"atlas-deer","full_name":"atlasapi/atlas-deer","owner":{"login":"atlasapi","id":325129,"avatar_url":"https://avatars.githubusercontent.com/u/325129?v=3","gravatar_id":"","url":"https://api.github.com/users/atlasapi","html_url":"https://github.com/atlasapi","followers_url":"https://api.github.com/users/atlasapi/followers","following_url":"https://api.github.com/users/atlasapi/following{/other_user}","gists_url":"https://api.github.com/users/atlasapi/gists{/gist_id}","starred_url":"https://api.github.com/users/atlasapi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atlasapi/subscriptions","organizations_url":"https://api.github.com/users/atlasapi/orgs","repos_url":"https://api.github.com/users/atlasapi/repos","events_url":"https://api.github.com/users/atlasapi/events{/privacy}","received_events_url":"https://api.github.com/users/atlasapi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atlasapi/atlas-deer","description":"the next version of atlas","fork":false,"url":"https://api.github.com/repos/atlasapi/atlas-deer","forks_url":"https://api.github.com/repos/atlasapi/atlas-deer/forks","keys_url":"https://api.github.com/repos/atlasapi/atlas-deer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atlasapi/atlas-deer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atlasapi/atlas-deer/teams","hooks_url":"https://api.github.com/repos/atlasapi/atlas-deer/hooks","issue_events_url":"https://api.github.com/repos/atlasapi/atlas-deer/issues/events{/number}","events_url":"https://api.github.com/repos/atlasapi/atlas-deer/events","assignees_url":"https://api.github.com/repos/atlasapi/atlas-deer/assignees{/user}","branches_url":"https://api.github.com/repos/atlasapi/atlas-deer/branches{/branch}","tags_url":"https://api.github.com/repos/atlasapi/atlas-deer/tags","blobs_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/refs{/sha}","trees_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atlasapi/atlas-deer/statuses/{sha}","languages_url":"https://api.github.com/repos/atlasapi/atlas-deer/languages","stargazers_url":"https://api.github.com/repos/atlasapi/atlas-deer/stargazers","contributors_url":"https://api.github.com/repos/atlasapi/atlas-deer/contributors","subscribers_url":"https://api.github.com/repos/atlasapi/atlas-deer/subscribers","subscription_url":"https://api.github.com/repos/atlasapi/atlas-deer/subscription","commits_url":"https://api.github.com/repos/atlasapi/atlas-deer/commits{/sha}","git_commits_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/commits{/sha}","comments_url":"https://api.github.com/repos/atlasapi/atlas-deer/comments{/number}","issue_comment_url":"https://api.github.com/repos/atlasapi/atlas-deer/issues/comments{/number}","contents_url":"https://api.github.com/repos/atlasapi/atlas-deer/contents/{+path}","compare_url":"https://api.github.com/repos/atlasapi/atlas-deer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atlasapi/atlas-deer/merges","archive_url":"https://api.github.com/repos/atlasapi/atlas-deer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atlasapi/atlas-deer/downloads","issues_url":"https://api.github.com/repos/atlasapi/atlas-deer/issues{/number}","pulls_url":"https://api.github.com/repos/atlasapi/atlas-deer/pulls{/number}","milestones_url":"https://api.github.com/repos/atlasapi/atlas-deer/milestones{/number}","notifications_url":"https://api.github.com/repos/atlasapi/atlas-deer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atlasapi/atlas-deer/labels{/name}","releases_url":"https://api.github.com/repos/atlasapi/atlas-deer/releases{/id}","created_at":"2013-11-04T17:07:28Z","updated_at":"2015-05-06T15:44:52Z","pushed_at":"2015-06-17T15:08:42Z","git_url":"git://github.com/atlasapi/atlas-deer.git","ssh_url":"git@github.com:atlasapi/atlas-deer.git","clone_url":"https://github.com/atlasapi/atlas-deer.git","svn_url":"https://github.com/atlasapi/atlas-deer","homepage":null,"size":5776,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":7,"forks":4,"open_issues":7,"watchers":2,"default_branch":"master"}},"base":{"label":"atlasapi:master","ref":"master","sha":"266b005191da4328c3db4d7a798eaa53a0ab2d2a","user":{"login":"atlasapi","id":325129,"avatar_url":"https://avatars.githubusercontent.com/u/325129?v=3","gravatar_id":"","url":"https://api.github.com/users/atlasapi","html_url":"https://github.com/atlasapi","followers_url":"https://api.github.com/users/atlasapi/followers","following_url":"https://api.github.com/users/atlasapi/following{/other_user}","gists_url":"https://api.github.com/users/atlasapi/gists{/gist_id}","starred_url":"https://api.github.com/users/atlasapi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atlasapi/subscriptions","organizations_url":"https://api.github.com/users/atlasapi/orgs","repos_url":"https://api.github.com/users/atlasapi/repos","events_url":"https://api.github.com/users/atlasapi/events{/privacy}","received_events_url":"https://api.github.com/users/atlasapi/received_events","type":"Organization","site_admin":false},"repo":{"id":14117583,"name":"atlas-deer","full_name":"atlasapi/atlas-deer","owner":{"login":"atlasapi","id":325129,"avatar_url":"https://avatars.githubusercontent.com/u/325129?v=3","gravatar_id":"","url":"https://api.github.com/users/atlasapi","html_url":"https://github.com/atlasapi","followers_url":"https://api.github.com/users/atlasapi/followers","following_url":"https://api.github.com/users/atlasapi/following{/other_user}","gists_url":"https://api.github.com/users/atlasapi/gists{/gist_id}","starred_url":"https://api.github.com/users/atlasapi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atlasapi/subscriptions","organizations_url":"https://api.github.com/users/atlasapi/orgs","repos_url":"https://api.github.com/users/atlasapi/repos","events_url":"https://api.github.com/users/atlasapi/events{/privacy}","received_events_url":"https://api.github.com/users/atlasapi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atlasapi/atlas-deer","description":"the next version of atlas","fork":false,"url":"https://api.github.com/repos/atlasapi/atlas-deer","forks_url":"https://api.github.com/repos/atlasapi/atlas-deer/forks","keys_url":"https://api.github.com/repos/atlasapi/atlas-deer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atlasapi/atlas-deer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atlasapi/atlas-deer/teams","hooks_url":"https://api.github.com/repos/atlasapi/atlas-deer/hooks","issue_events_url":"https://api.github.com/repos/atlasapi/atlas-deer/issues/events{/number}","events_url":"https://api.github.com/repos/atlasapi/atlas-deer/events","assignees_url":"https://api.github.com/repos/atlasapi/atlas-deer/assignees{/user}","branches_url":"https://api.github.com/repos/atlasapi/atlas-deer/branches{/branch}","tags_url":"https://api.github.com/repos/atlasapi/atlas-deer/tags","blobs_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/refs{/sha}","trees_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atlasapi/atlas-deer/statuses/{sha}","languages_url":"https://api.github.com/repos/atlasapi/atlas-deer/languages","stargazers_url":"https://api.github.com/repos/atlasapi/atlas-deer/stargazers","contributors_url":"https://api.github.com/repos/atlasapi/atlas-deer/contributors","subscribers_url":"https://api.github.com/repos/atlasapi/atlas-deer/subscribers","subscription_url":"https://api.github.com/repos/atlasapi/atlas-deer/subscription","commits_url":"https://api.github.com/repos/atlasapi/atlas-deer/commits{/sha}","git_commits_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/commits{/sha}","comments_url":"https://api.github.com/repos/atlasapi/atlas-deer/comments{/number}","issue_comment_url":"https://api.github.com/repos/atlasapi/atlas-deer/issues/comments{/number}","contents_url":"https://api.github.com/repos/atlasapi/atlas-deer/contents/{+path}","compare_url":"https://api.github.com/repos/atlasapi/atlas-deer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atlasapi/atlas-deer/merges","archive_url":"https://api.github.com/repos/atlasapi/atlas-deer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atlasapi/atlas-deer/downloads","issues_url":"https://api.github.com/repos/atlasapi/atlas-deer/issues{/number}","pulls_url":"https://api.github.com/repos/atlasapi/atlas-deer/pulls{/number}","milestones_url":"https://api.github.com/repos/atlasapi/atlas-deer/milestones{/number}","notifications_url":"https://api.github.com/repos/atlasapi/atlas-deer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atlasapi/atlas-deer/labels{/name}","releases_url":"https://api.github.com/repos/atlasapi/atlas-deer/releases{/id}","created_at":"2013-11-04T17:07:28Z","updated_at":"2015-05-06T15:44:52Z","pushed_at":"2015-06-17T15:08:42Z","git_url":"git://github.com/atlasapi/atlas-deer.git","ssh_url":"git@github.com:atlasapi/atlas-deer.git","clone_url":"https://github.com/atlasapi/atlas-deer.git","svn_url":"https://github.com/atlasapi/atlas-deer","homepage":null,"size":5776,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":7,"forks":4,"open_issues":7,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/102"},"html":{"href":"https://github.com/atlasapi/atlas-deer/pull/102"},"issue":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/issues/102"},"comments":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/issues/102/comments"},"review_comments":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/102/comments"},"review_comment":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/102/commits"},"statuses":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/statuses/0af1af8ea3b1c63c33a54cdf54023d9ffabdf663"}}}}