{"action":"created","comment":{"url":"https://api.github.com/repos/hypothesis/h/pulls/comments/209302614","pull_request_review_id":145295826,"id":209302614,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTMwMjYxNA==","diff_hunk":"@@ -34,14 +35,25 @@ class Search(object):\n     :type stats: statsd.client.StatsClient\n     \"\"\"\n     def __init__(self, request, separate_replies=False, stats=None, _replies_limit=200):\n-        self.request = request\n-        self.es = request.es\n+        self.es_index = request.es.index\n         self.separate_replies = separate_replies\n         self.stats = stats\n         self._replies_limit = _replies_limit\n-\n-        self.builder = self._default_querybuilder(request, self.es)\n-        self.reply_builder = self._default_querybuilder(request, self.es)\n+        # Order matters!!! The KeyValueMatcher must be run last,\n+        # after all other qualifiers have popped off the params.","path":"h/search/core.py","position":22,"original_position":22,"commit_id":"119b4005e81c449f427683ce1e530c3c0ab87f48","original_commit_id":"119b4005e81c449f427683ce1e530c3c0ab87f48","user":{"login":"hmstepanek","id":30059933,"node_id":"MDQ6VXNlcjMwMDU5OTMz","avatar_url":"https://avatars1.githubusercontent.com/u/30059933?v=4","gravatar_id":"","url":"https://api.github.com/users/hmstepanek","html_url":"https://github.com/hmstepanek","followers_url":"https://api.github.com/users/hmstepanek/followers","following_url":"https://api.github.com/users/hmstepanek/following{/other_user}","gists_url":"https://api.github.com/users/hmstepanek/gists{/gist_id}","starred_url":"https://api.github.com/users/hmstepanek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmstepanek/subscriptions","organizations_url":"https://api.github.com/users/hmstepanek/orgs","repos_url":"https://api.github.com/users/hmstepanek/repos","events_url":"https://api.github.com/users/hmstepanek/events{/privacy}","received_events_url":"https://api.github.com/users/hmstepanek/received_events","type":"User","site_admin":false},"body":"We could but I'm not a huge fan of that 1) because it means the clear method doesn't actually clear everything and 2) it hides things inside the run method. I really like having this list here because it exposes the previously hidden complexity and I know that these are all the things it runs. (Minus the RepliesFilter which I'm ok with cause it's specific to that's how we get replies and the separate_replies feature.) The more we can make things explicit the more readable the code is. For example I didn't even know we had a KeyValueMatcher catch-all until I ran the old_search_tests. ","created_at":"2018-08-10T15:43:03Z","updated_at":"2018-08-10T15:43:03Z","html_url":"https://github.com/hypothesis/h/pull/5219#discussion_r209302614","pull_request_url":"https://api.github.com/repos/hypothesis/h/pulls/5219","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/hypothesis/h/pulls/comments/209302614"},"html":{"href":"https://github.com/hypothesis/h/pull/5219#discussion_r209302614"},"pull_request":{"href":"https://api.github.com/repos/hypothesis/h/pulls/5219"}},"in_reply_to_id":209239406},"pull_request":{"url":"https://api.github.com/repos/hypothesis/h/pulls/5219","id":207421144,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3NDIxMTQ0","html_url":"https://github.com/hypothesis/h/pull/5219","diff_url":"https://github.com/hypothesis/h/pull/5219.diff","patch_url":"https://github.com/hypothesis/h/pull/5219.patch","issue_url":"https://api.github.com/repos/hypothesis/h/issues/5219","number":5219,"state":"open","locked":false,"title":"Replace Builder class with elasticsearch_dsl","user":{"login":"hmstepanek","id":30059933,"node_id":"MDQ6VXNlcjMwMDU5OTMz","avatar_url":"https://avatars1.githubusercontent.com/u/30059933?v=4","gravatar_id":"","url":"https://api.github.com/users/hmstepanek","html_url":"https://github.com/hmstepanek","followers_url":"https://api.github.com/users/hmstepanek/followers","following_url":"https://api.github.com/users/hmstepanek/following{/other_user}","gists_url":"https://api.github.com/users/hmstepanek/gists{/gist_id}","starred_url":"https://api.github.com/users/hmstepanek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmstepanek/subscriptions","organizations_url":"https://api.github.com/users/hmstepanek/orgs","repos_url":"https://api.github.com/users/hmstepanek/repos","events_url":"https://api.github.com/users/hmstepanek/events{/privacy}","received_events_url":"https://api.github.com/users/hmstepanek/received_events","type":"User","site_admin":false},"body":"The Builder class is a customized version of elasticsearch-dsl. It is a legacy class that was made back when there was no solution for building elasticsearch queries. Replacing the Builder class with elasticsearch-dsl reduces the code size and reduces hidden complexity that previously existed inside the Builder class (for example making the sorters and limiters into their own qualifier class).","created_at":"2018-08-09T19:37:19Z","updated_at":"2018-08-10T15:43:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34669efe9e22406ec73f8cada7d0090643372f19","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":546994724,"node_id":"MDU6TGFiZWw1NDY5OTQ3MjQ=","url":"https://api.github.com/repos/hypothesis/h/labels/WIP","name":"WIP","color":"d4c5f9","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/hypothesis/h/pulls/5219/commits","review_comments_url":"https://api.github.com/repos/hypothesis/h/pulls/5219/comments","review_comment_url":"https://api.github.com/repos/hypothesis/h/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hypothesis/h/issues/5219/comments","statuses_url":"https://api.github.com/repos/hypothesis/h/statuses/119b4005e81c449f427683ce1e530c3c0ab87f48","head":{"label":"hypothesis:replace-builder-with-dsl","ref":"replace-builder-with-dsl","sha":"119b4005e81c449f427683ce1e530c3c0ab87f48","user":{"login":"hypothesis","id":1243215,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNDMyMTU=","avatar_url":"https://avatars1.githubusercontent.com/u/1243215?v=4","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"repo":{"id":3910945,"node_id":"MDEwOlJlcG9zaXRvcnkzOTEwOTQ1","name":"h","full_name":"hypothesis/h","owner":{"login":"hypothesis","id":1243215,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNDMyMTU=","avatar_url":"https://avatars1.githubusercontent.com/u/1243215?v=4","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hypothesis/h","description":"Annotate with anyone, anywhere.","fork":false,"url":"https://api.github.com/repos/hypothesis/h","forks_url":"https://api.github.com/repos/hypothesis/h/forks","keys_url":"https://api.github.com/repos/hypothesis/h/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hypothesis/h/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hypothesis/h/teams","hooks_url":"https://api.github.com/repos/hypothesis/h/hooks","issue_events_url":"https://api.github.com/repos/hypothesis/h/issues/events{/number}","events_url":"https://api.github.com/repos/hypothesis/h/events","assignees_url":"https://api.github.com/repos/hypothesis/h/assignees{/user}","branches_url":"https://api.github.com/repos/hypothesis/h/branches{/branch}","tags_url":"https://api.github.com/repos/hypothesis/h/tags","blobs_url":"https://api.github.com/repos/hypothesis/h/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hypothesis/h/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hypothesis/h/git/refs{/sha}","trees_url":"https://api.github.com/repos/hypothesis/h/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hypothesis/h/statuses/{sha}","languages_url":"https://api.github.com/repos/hypothesis/h/languages","stargazers_url":"https://api.github.com/repos/hypothesis/h/stargazers","contributors_url":"https://api.github.com/repos/hypothesis/h/contributors","subscribers_url":"https://api.github.com/repos/hypothesis/h/subscribers","subscription_url":"https://api.github.com/repos/hypothesis/h/subscription","commits_url":"https://api.github.com/repos/hypothesis/h/commits{/sha}","git_commits_url":"https://api.github.com/repos/hypothesis/h/git/commits{/sha}","comments_url":"https://api.github.com/repos/hypothesis/h/comments{/number}","issue_comment_url":"https://api.github.com/repos/hypothesis/h/issues/comments{/number}","contents_url":"https://api.github.com/repos/hypothesis/h/contents/{+path}","compare_url":"https://api.github.com/repos/hypothesis/h/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hypothesis/h/merges","archive_url":"https://api.github.com/repos/hypothesis/h/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hypothesis/h/downloads","issues_url":"https://api.github.com/repos/hypothesis/h/issues{/number}","pulls_url":"https://api.github.com/repos/hypothesis/h/pulls{/number}","milestones_url":"https://api.github.com/repos/hypothesis/h/milestones{/number}","notifications_url":"https://api.github.com/repos/hypothesis/h/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hypothesis/h/labels{/name}","releases_url":"https://api.github.com/repos/hypothesis/h/releases{/id}","deployments_url":"https://api.github.com/repos/hypothesis/h/deployments","created_at":"2012-04-02T19:56:59Z","updated_at":"2018-08-10T09:07:34Z","pushed_at":"2018-08-10T09:17:27Z","git_url":"git://github.com/hypothesis/h.git","ssh_url":"git@github.com:hypothesis/h.git","clone_url":"https://github.com/hypothesis/h.git","svn_url":"https://github.com/hypothesis/h","homepage":"https://hypothes.is/","size":30152,"stargazers_count":1194,"watchers_count":1194,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":270,"mirror_url":null,"archived":false,"open_issues_count":78,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":270,"open_issues":78,"watchers":1194,"default_branch":"master"}},"base":{"label":"hypothesis:master","ref":"master","sha":"484618b9dac9eb3abf7646ede1716529cf4d60f7","user":{"login":"hypothesis","id":1243215,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNDMyMTU=","avatar_url":"https://avatars1.githubusercontent.com/u/1243215?v=4","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"repo":{"id":3910945,"node_id":"MDEwOlJlcG9zaXRvcnkzOTEwOTQ1","name":"h","full_name":"hypothesis/h","owner":{"login":"hypothesis","id":1243215,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNDMyMTU=","avatar_url":"https://avatars1.githubusercontent.com/u/1243215?v=4","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hypothesis/h","description":"Annotate with anyone, anywhere.","fork":false,"url":"https://api.github.com/repos/hypothesis/h","forks_url":"https://api.github.com/repos/hypothesis/h/forks","keys_url":"https://api.github.com/repos/hypothesis/h/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hypothesis/h/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hypothesis/h/teams","hooks_url":"https://api.github.com/repos/hypothesis/h/hooks","issue_events_url":"https://api.github.com/repos/hypothesis/h/issues/events{/number}","events_url":"https://api.github.com/repos/hypothesis/h/events","assignees_url":"https://api.github.com/repos/hypothesis/h/assignees{/user}","branches_url":"https://api.github.com/repos/hypothesis/h/branches{/branch}","tags_url":"https://api.github.com/repos/hypothesis/h/tags","blobs_url":"https://api.github.com/repos/hypothesis/h/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hypothesis/h/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hypothesis/h/git/refs{/sha}","trees_url":"https://api.github.com/repos/hypothesis/h/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hypothesis/h/statuses/{sha}","languages_url":"https://api.github.com/repos/hypothesis/h/languages","stargazers_url":"https://api.github.com/repos/hypothesis/h/stargazers","contributors_url":"https://api.github.com/repos/hypothesis/h/contributors","subscribers_url":"https://api.github.com/repos/hypothesis/h/subscribers","subscription_url":"https://api.github.com/repos/hypothesis/h/subscription","commits_url":"https://api.github.com/repos/hypothesis/h/commits{/sha}","git_commits_url":"https://api.github.com/repos/hypothesis/h/git/commits{/sha}","comments_url":"https://api.github.com/repos/hypothesis/h/comments{/number}","issue_comment_url":"https://api.github.com/repos/hypothesis/h/issues/comments{/number}","contents_url":"https://api.github.com/repos/hypothesis/h/contents/{+path}","compare_url":"https://api.github.com/repos/hypothesis/h/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hypothesis/h/merges","archive_url":"https://api.github.com/repos/hypothesis/h/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hypothesis/h/downloads","issues_url":"https://api.github.com/repos/hypothesis/h/issues{/number}","pulls_url":"https://api.github.com/repos/hypothesis/h/pulls{/number}","milestones_url":"https://api.github.com/repos/hypothesis/h/milestones{/number}","notifications_url":"https://api.github.com/repos/hypothesis/h/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hypothesis/h/labels{/name}","releases_url":"https://api.github.com/repos/hypothesis/h/releases{/id}","deployments_url":"https://api.github.com/repos/hypothesis/h/deployments","created_at":"2012-04-02T19:56:59Z","updated_at":"2018-08-10T09:07:34Z","pushed_at":"2018-08-10T09:17:27Z","git_url":"git://github.com/hypothesis/h.git","ssh_url":"git@github.com:hypothesis/h.git","clone_url":"https://github.com/hypothesis/h.git","svn_url":"https://github.com/hypothesis/h","homepage":"https://hypothes.is/","size":30152,"stargazers_count":1194,"watchers_count":1194,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":270,"mirror_url":null,"archived":false,"open_issues_count":78,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":270,"open_issues":78,"watchers":1194,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hypothesis/h/pulls/5219"},"html":{"href":"https://github.com/hypothesis/h/pull/5219"},"issue":{"href":"https://api.github.com/repos/hypothesis/h/issues/5219"},"comments":{"href":"https://api.github.com/repos/hypothesis/h/issues/5219/comments"},"review_comments":{"href":"https://api.github.com/repos/hypothesis/h/pulls/5219/comments"},"review_comment":{"href":"https://api.github.com/repos/hypothesis/h/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hypothesis/h/pulls/5219/commits"},"statuses":{"href":"https://api.github.com/repos/hypothesis/h/statuses/119b4005e81c449f427683ce1e530c3c0ab87f48"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"hmstepanek"}}