GitHub PullRequestReviewCommentEvent at 2014-09-17 16:37:25
Repository: olympia
Actor: yohanboniface
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/olympia/pulls/comments/17675829","id":17675829,"diff_hunk":"@@ -169,35 +124,56 @@ def _build_query(self):\n                 queries.extend(self._process_queries(value))\n             elif action == 'filter':\n                 filters.extend(self._process_filters(value))\n+            elif action == 'source':\n+                source.extend(value)\n             elif action == 'facet':\n                 facets.update(value)\n             else:\n                 raise NotImplementedError(action)\n \n-        qs = {}\n-        if len(filters) > 1:\n-            qs['filter'] = {'and': filters}\n-        elif filters:\n-            qs['filter'] = filters[0]\n-\n         if len(queries) > 1:\n-            qs['query'] = {'bool': {'must': queries}}\n+            qs = {'bool': {'must': queries}}\n         elif queries:\n-            qs['query'] = queries[0]\n-\n-        if fields:\n-            qs['fields'] = fields\n-        if facets:\n-            qs['facets'] = facets\n+            qs = queries[0]\n+        else:\n+            qs = {\"match_all\": {}}\n+\n+        qs = {\n+            \"function_score\": {\n+                \"query\": qs,\n+                \"functions\": [{\"field_value_factor\": {\"field\": \"boost\"}}]\n+            }\n+        }\n+\n+        if filters:\n+            if len(filters) > 1:","path":"apps/amo/search.py","position":133,"original_position":133,"commit_id":"4dd777b04e6f4cb94cb5e605759db33f3c1d79df","original_commit_id":"4dd777b04e6f4cb94cb5e605759db33f3c1d79df","user":{"login":"yohanboniface","id":146023,"avatar_url":"https://avatars.githubusercontent.com/u/146023?v=2","gravatar_id":"a6404bbbb731ddfaf0a297077495989b","url":"https://api.github.com/users/yohanboniface","html_url":"https://github.com/yohanboniface","followers_url":"https://api.github.com/users/yohanboniface/followers","following_url":"https://api.github.com/users/yohanboniface/following{/other_user}","gists_url":"https://api.github.com/users/yohanboniface/gists{/gist_id}","starred_url":"https://api.github.com/users/yohanboniface/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yohanboniface/subscriptions","organizations_url":"https://api.github.com/users/yohanboniface/orgs","repos_url":"https://api.github.com/users/yohanboniface/repos","events_url":"https://api.github.com/users/yohanboniface/events{/privacy}","received_events_url":"https://api.github.com/users/yohanboniface/received_events","type":"User","site_admin":false},"body":"A list of filters","created_at":"2014-09-17T16:37:25Z","updated_at":"2014-09-17T16:37:25Z","html_url":"https://github.com/mozilla/olympia/pull/269#discussion_r17675829","pull_request_url":"https://api.github.com/repos/mozilla/olympia/pulls/269","_links":{"self":{"href":"https://api.github.com/repos/mozilla/olympia/pulls/comments/17675829"},"html":{"href":"https://github.com/mozilla/olympia/pull/269#discussion_r17675829"},"pull_request":{"href":"https://api.github.com/repos/mozilla/olympia/pulls/269"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/olympia/pulls/269","id":20958537,"html_url":"https://github.com/mozilla/olympia/pull/269","diff_url":"https://github.com/mozilla/olympia/pull/269.diff","patch_url":"https://github.com/mozilla/olympia/pull/269.patch","issue_url":"https://api.github.com/repos/mozilla/olympia/issues/269","number":269,"state":"open","locked":false,"title":"Upgrading Elasticsearch (bug 1013874)","user":{"login":"yohanboniface","id":146023,"avatar_url":"https://avatars.githubusercontent.com/u/146023?v=2","gravatar_id":"a6404bbbb731ddfaf0a297077495989b","url":"https://api.github.com/users/yohanboniface","html_url":"https://github.com/yohanboniface","followers_url":"https://api.github.com/users/yohanboniface/followers","following_url":"https://api.github.com/users/yohanboniface/following{/other_user}","gists_url":"https://api.github.com/users/yohanboniface/gists{/gist_id}","starred_url":"https://api.github.com/users/yohanboniface/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yohanboniface/subscriptions","organizations_url":"https://api.github.com/users/yohanboniface/orgs","repos_url":"https://api.github.com/users/yohanboniface/repos","events_url":"https://api.github.com/users/yohanboniface/events{/privacy}","received_events_url":"https://api.github.com/users/yohanboniface/received_events","type":"User","site_admin":false},"body":"Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=1013874","created_at":"2014-09-09T14:25:31Z","updated_at":"2014-09-17T16:37:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f5b23f003fd7b2b987e3a4c83cf65bbf08c23393","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/olympia/pulls/269/commits","review_comments_url":"https://api.github.com/repos/mozilla/olympia/pulls/269/comments","review_comment_url":"https://api.github.com/repos/mozilla/olympia/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mozilla/olympia/issues/269/comments","statuses_url":"https://api.github.com/repos/mozilla/olympia/statuses/4dd777b04e6f4cb94cb5e605759db33f3c1d79df","head":{"label":"mozilla:1013874-es-upgrade","ref":"1013874-es-upgrade","sha":"4dd777b04e6f4cb94cb5e605759db33f3c1d79df","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=2","gravatar_id":"9ba739c8f3288e256b13553e4d257b5e","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":16416867,"name":"olympia","full_name":"mozilla/olympia","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=2","gravatar_id":"9ba739c8f3288e256b13553e4d257b5e","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/olympia","description":"addons.mozilla.org, reloaded.","fork":false,"url":"https://api.github.com/repos/mozilla/olympia","forks_url":"https://api.github.com/repos/mozilla/olympia/forks","keys_url":"https://api.github.com/repos/mozilla/olympia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/olympia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/olympia/teams","hooks_url":"https://api.github.com/repos/mozilla/olympia/hooks","issue_events_url":"https://api.github.com/repos/mozilla/olympia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/olympia/events","assignees_url":"https://api.github.com/repos/mozilla/olympia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/olympia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/olympia/tags","blobs_url":"https://api.github.com/repos/mozilla/olympia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/olympia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/olympia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/olympia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/olympia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/olympia/languages","stargazers_url":"https://api.github.com/repos/mozilla/olympia/stargazers","contributors_url":"https://api.github.com/repos/mozilla/olympia/contributors","subscribers_url":"https://api.github.com/repos/mozilla/olympia/subscribers","subscription_url":"https://api.github.com/repos/mozilla/olympia/subscription","commits_url":"https://api.github.com/repos/mozilla/olympia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/olympia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/olympia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/olympia/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla/olympia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/olympia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/olympia/merges","archive_url":"https://api.github.com/repos/mozilla/olympia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/olympia/downloads","issues_url":"https://api.github.com/repos/mozilla/olympia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/olympia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/olympia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/olympia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/olympia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/olympia/releases{/id}","created_at":"2014-01-31T18:44:15Z","updated_at":"2014-09-15T08:58:22Z","pushed_at":"2014-09-17T16:10:32Z","git_url":"git://github.com/mozilla/olympia.git","ssh_url":"git@github.com:mozilla/olympia.git","clone_url":"https://github.com/mozilla/olympia.git","svn_url":"https://github.com/mozilla/olympia","homepage":"https://addons.mozilla.org/","size":302545,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":43,"mirror_url":null,"open_issues_count":8,"forks":43,"open_issues":8,"watchers":14,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"661985437b098e03ef13c04be7fc0cd00979290e","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=2","gravatar_id":"9ba739c8f3288e256b13553e4d257b5e","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":16416867,"name":"olympia","full_name":"mozilla/olympia","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=2","gravatar_id":"9ba739c8f3288e256b13553e4d257b5e","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/olympia","description":"addons.mozilla.org, reloaded.","fork":false,"url":"https://api.github.com/repos/mozilla/olympia","forks_url":"https://api.github.com/repos/mozilla/olympia/forks","keys_url":"https://api.github.com/repos/mozilla/olympia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/olympia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/olympia/teams","hooks_url":"https://api.github.com/repos/mozilla/olympia/hooks","issue_events_url":"https://api.github.com/repos/mozilla/olympia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/olympia/events","assignees_url":"https://api.github.com/repos/mozilla/olympia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/olympia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/olympia/tags","blobs_url":"https://api.github.com/repos/mozilla/olympia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/olympia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/olympia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/olympia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/olympia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/olympia/languages","stargazers_url":"https://api.github.com/repos/mozilla/olympia/stargazers","contributors_url":"https://api.github.com/repos/mozilla/olympia/contributors","subscribers_url":"https://api.github.com/repos/mozilla/olympia/subscribers","subscription_url":"https://api.github.com/repos/mozilla/olympia/subscription","commits_url":"https://api.github.com/repos/mozilla/olympia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/olympia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/olympia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/olympia/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla/olympia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/olympia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/olympia/merges","archive_url":"https://api.github.com/repos/mozilla/olympia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/olympia/downloads","issues_url":"https://api.github.com/repos/mozilla/olympia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/olympia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/olympia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/olympia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/olympia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/olympia/releases{/id}","created_at":"2014-01-31T18:44:15Z","updated_at":"2014-09-15T08:58:22Z","pushed_at":"2014-09-17T16:10:32Z","git_url":"git://github.com/mozilla/olympia.git","ssh_url":"git@github.com:mozilla/olympia.git","clone_url":"https://github.com/mozilla/olympia.git","svn_url":"https://github.com/mozilla/olympia","homepage":"https://addons.mozilla.org/","size":302545,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":43,"mirror_url":null,"open_issues_count":8,"forks":43,"open_issues":8,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/olympia/pulls/269"},"html":{"href":"https://github.com/mozilla/olympia/pull/269"},"issue":{"href":"https://api.github.com/repos/mozilla/olympia/issues/269"},"comments":{"href":"https://api.github.com/repos/mozilla/olympia/issues/269/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/olympia/pulls/269/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/olympia/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mozilla/olympia/pulls/269/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/olympia/statuses/4dd777b04e6f4cb94cb5e605759db33f3c1d79df"}}}}