{"action":"created","comment":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments/58740671","id":58740671,"diff_hunk":"@@ -0,0 +1,55 @@\n+/* globals hqDefine, ko, $, CodeMirror */\n+\n+hqDefine('case_search/js/case_search.js', function(){\n+    'use strict';\n+    return function(case_data_url){\n+        var self = this;\n+        self.codeMirror = null;\n+        self.type = ko.observable();\n+        self.results = ko.observableArray();\n+        self.case_data_url = case_data_url;\n+        self.parameters = ko.observableArray([{\n+            key: \"\",\n+            value: \"\",\n+            clause: \"must\",\n+            fuzzy: false\n+        }]);\n+\n+        self.addParameter = function(){\n+            self.parameters.push({\n+                key: \"\",\n+                value: \"\",\n+                clause: \"must\",\n+                fuzzy: false\n+            });\n+        };\n+        self.removeParameter = function(){\n+            self.parameters.remove(this);\n+        };\n+\n+        self.submit = function(){\n+            self.results([]);\n+            $.post(\n+                window.location.href,\n+                {q: JSON.stringify({type: self.type(), parameters: self.parameters()})}\n+            ).success(function(data){\n+                self.results(data.values);\n+                var values = JSON.stringify(data.values, null, '    ');\n+                if (self.codeMirror === null){\n+                    self.codeMirror = CodeMirror( $(\"#raw-results\").get(0), {\n+                        value: values,\n+                        mode: { name: 'javascript', json: true },\n+                        readOnly: true,\n+                        lineNumbers: true,\n+                        lineWrapping: true,\n+                        viewportMargin: Infinity,\n+                        foldGutter: true,\n+                        gutters: [\"CodeMirror-linenumbers\", \"CodeMirror-foldgutter\"]","path":"corehq/apps/case_search/static/case_search/js/case_search.js","position":47,"original_position":47,"commit_id":"819f57acad2d744de2f17bf0cc5e86e0fd84efdc","original_commit_id":"819f57acad2d744de2f17bf0cc5e86e0fd84efdc","user":{"login":"dimagimon","id":1179034,"avatar_url":"https://avatars.githubusercontent.com/u/1179034?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagimon","html_url":"https://github.com/dimagimon","followers_url":"https://api.github.com/users/dimagimon/followers","following_url":"https://api.github.com/users/dimagimon/following{/other_user}","gists_url":"https://api.github.com/users/dimagimon/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagimon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagimon/subscriptions","organizations_url":"https://api.github.com/users/dimagimon/orgs","repos_url":"https://api.github.com/users/dimagimon/repos","events_url":"https://api.github.com/users/dimagimon/events{/privacy}","received_events_url":"https://api.github.com/users/dimagimon/received_events","type":"User","site_admin":false},"body":"Missing trailing comma. (comma-dangle)","created_at":"2016-04-06T16:48:38Z","updated_at":"2016-04-06T16:48:38Z","html_url":"https://github.com/dimagi/commcare-hq/pull/10981#discussion_r58740671","pull_request_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/10981","_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments/58740671"},"html":{"href":"https://github.com/dimagi/commcare-hq/pull/10981#discussion_r58740671"},"pull_request":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/10981"}}},"pull_request":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/10981","id":64539271,"html_url":"https://github.com/dimagi/commcare-hq/pull/10981","diff_url":"https://github.com/dimagi/commcare-hq/pull/10981.diff","patch_url":"https://github.com/dimagi/commcare-hq/pull/10981.patch","issue_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/10981","number":10981,"state":"open","locked":false,"title":"Case search pillow","user":{"login":"proteusvacuum","id":146896,"avatar_url":"https://avatars.githubusercontent.com/u/146896?v=3","gravatar_id":"","url":"https://api.github.com/users/proteusvacuum","html_url":"https://github.com/proteusvacuum","followers_url":"https://api.github.com/users/proteusvacuum/followers","following_url":"https://api.github.com/users/proteusvacuum/following{/other_user}","gists_url":"https://api.github.com/users/proteusvacuum/gists{/gist_id}","starred_url":"https://api.github.com/users/proteusvacuum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/proteusvacuum/subscriptions","organizations_url":"https://api.github.com/users/proteusvacuum/orgs","repos_url":"https://api.github.com/users/proteusvacuum/repos","events_url":"https://api.github.com/users/proteusvacuum/events{/privacy}","received_events_url":"https://api.github.com/users/proteusvacuum/received_events","type":"User","site_admin":false},"body":"Starting point for case search. \r\nLeaving the do not merge on as want to get feedback. \r\nThis also includes a janky debug view to test searches (will work on the UI for this later, this was just to get something out there)\r\n\r\n@kaapstorm - haven't added your feedback from the last branch yet \r\n@czue - FYI\r\n\r\ncc: @gcapalbo @orangejenny \r\n\r\n(@esoergel could you check over the ES stuff -- there will be more additions when I add the ability to boost different properties, but this is a starting point). \r\n","created_at":"2016-03-29T21:44:59Z","updated_at":"2016-04-06T16:48:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c21715542002788a1a9568bb761fbf355ef0416","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/10981/commits","review_comments_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/10981/comments","review_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/10981/comments","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/819f57acad2d744de2f17bf0cc5e86e0fd84efdc","head":{"label":"dimagi:uatbc/case-search-es","ref":"uatbc/case-search-es","sha":"819f57acad2d744de2f17bf0cc5e86e0fd84efdc","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":247278,"name":"commcare-hq","full_name":"dimagi/commcare-hq","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare-hq","description":"A server-side tool to help manage community health workers, written in Django","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-hq","forks_url":"https://api.github.com/repos/dimagi/commcare-hq/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-hq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-hq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-hq/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-hq/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-hq/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-hq/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-hq/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-hq/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-hq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-hq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-hq/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-hq/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-hq/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-hq/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-hq/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-hq/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-hq/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare-hq/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-hq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-hq/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-hq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-hq/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-hq/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-hq/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-hq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-hq/releases{/id}","deployments_url":"https://api.github.com/repos/dimagi/commcare-hq/deployments","created_at":"2009-07-09T17:00:07Z","updated_at":"2016-03-28T17:34:24Z","pushed_at":"2016-04-06T16:48:33Z","git_url":"git://github.com/dimagi/commcare-hq.git","ssh_url":"git@github.com:dimagi/commcare-hq.git","clone_url":"https://github.com/dimagi/commcare-hq.git","svn_url":"https://github.com/dimagi/commcare-hq","homepage":"http://www.commcarehq.org","size":260270,"stargazers_count":66,"watchers_count":66,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":68,"mirror_url":null,"open_issues_count":64,"forks":68,"open_issues":64,"watchers":66,"default_branch":"master"}},"base":{"label":"dimagi:master","ref":"master","sha":"564f85a388a02d2f80c970ec092dba069ab4c74e","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":247278,"name":"commcare-hq","full_name":"dimagi/commcare-hq","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare-hq","description":"A server-side tool to help manage community health workers, written in Django","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-hq","forks_url":"https://api.github.com/repos/dimagi/commcare-hq/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-hq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-hq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-hq/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-hq/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-hq/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-hq/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-hq/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-hq/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-hq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-hq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-hq/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-hq/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-hq/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-hq/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-hq/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-hq/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-hq/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare-hq/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-hq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-hq/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-hq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-hq/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-hq/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-hq/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-hq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-hq/releases{/id}","deployments_url":"https://api.github.com/repos/dimagi/commcare-hq/deployments","created_at":"2009-07-09T17:00:07Z","updated_at":"2016-03-28T17:34:24Z","pushed_at":"2016-04-06T16:48:33Z","git_url":"git://github.com/dimagi/commcare-hq.git","ssh_url":"git@github.com:dimagi/commcare-hq.git","clone_url":"https://github.com/dimagi/commcare-hq.git","svn_url":"https://github.com/dimagi/commcare-hq","homepage":"http://www.commcarehq.org","size":260270,"stargazers_count":66,"watchers_count":66,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":68,"mirror_url":null,"open_issues_count":64,"forks":68,"open_issues":64,"watchers":66,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/10981"},"html":{"href":"https://github.com/dimagi/commcare-hq/pull/10981"},"issue":{"href":"https://api.github.com/repos/dimagi/commcare-hq/issues/10981"},"comments":{"href":"https://api.github.com/repos/dimagi/commcare-hq/issues/10981/comments"},"review_comments":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/10981/comments"},"review_comment":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/10981/commits"},"statuses":{"href":"https://api.github.com/repos/dimagi/commcare-hq/statuses/819f57acad2d744de2f17bf0cc5e86e0fd84efdc"}}}}