{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/43279608","id":43279608,"diff_hunk":"@@ -62,11 +63,21 @@ protected void doXContent(XContentBuilder builder, Params params)\n     @Override\n     protected Query doToQuery(QueryShardContext context) throws IOException {\n         Query subQuery = multiTermQueryBuilder.toQuery(context);\n+        float boost = 1f;\n+        if (subQuery instanceof BoostQuery) {\n+            BoostQuery boostQuery = (BoostQuery) subQuery;\n+            subQuery = boostQuery.getQuery();\n+            boost = boostQuery.getBoost();\n+        }\n         if (subQuery instanceof MultiTermQuery == false) {\n             throw new UnsupportedOperationException(\"unsupported inner query, should be \" + MultiTermQuery.class.getName() +\" but was \"\n                     + subQuery.getClass().getName());\n         }\n-        return new SpanMultiTermQueryWrapper<>((MultiTermQuery) subQuery);\n+        Query wrapper = new SpanMultiTermQueryWrapper<>((MultiTermQuery) subQuery);\n+        if (boost != 1f) {\n+            wrapper = new BoostQuery(wrapper, boost);","path":"core/src/main/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilder.java","position":null,"original_position":25,"commit_id":"65891223005393fada69e72755f68d0ea4437a0e","original_commit_id":"4a9cd0a6ddb9f6daa6d3cc1748067d9d53957bed","user":{"login":"javanna","id":832460,"avatar_url":"https://avatars.githubusercontent.com/u/832460?v=3","gravatar_id":"","url":"https://api.github.com/users/javanna","html_url":"https://github.com/javanna","followers_url":"https://api.github.com/users/javanna/followers","following_url":"https://api.github.com/users/javanna/following{/other_user}","gists_url":"https://api.github.com/users/javanna/gists{/gist_id}","starred_url":"https://api.github.com/users/javanna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javanna/subscriptions","organizations_url":"https://api.github.com/users/javanna/orgs","repos_url":"https://api.github.com/users/javanna/repos","events_url":"https://api.github.com/users/javanna/events{/privacy}","received_events_url":"https://api.github.com/users/javanna/received_events","type":"User","site_admin":false},"body":"moved to SpanBoostQuery and added a test that fails without it","created_at":"2015-10-28T16:23:49Z","updated_at":"2015-10-28T16:23:49Z","html_url":"https://github.com/elastic/elasticsearch/pull/14264#discussion_r43279608","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/14264","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/43279608"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/14264#discussion_r43279608"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/14264"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/14264","id":48578886,"html_url":"https://github.com/elastic/elasticsearch/pull/14264","diff_url":"https://github.com/elastic/elasticsearch/pull/14264.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/14264.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/14264","number":14264,"state":"open","locked":false,"title":"Move to lucene BoostQuery","user":{"login":"javanna","id":832460,"avatar_url":"https://avatars.githubusercontent.com/u/832460?v=3","gravatar_id":"","url":"https://api.github.com/users/javanna","html_url":"https://github.com/javanna","followers_url":"https://api.github.com/users/javanna/followers","following_url":"https://api.github.com/users/javanna/following{/other_user}","gists_url":"https://api.github.com/users/javanna/gists{/gist_id}","starred_url":"https://api.github.com/users/javanna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javanna/subscriptions","organizations_url":"https://api.github.com/users/javanna/orgs","repos_url":"https://api.github.com/users/javanna/repos","events_url":"https://api.github.com/users/javanna/events{/privacy}","received_events_url":"https://api.github.com/users/javanna/received_events","type":"User","site_admin":false},"body":"Latest version of lucene deprecated `Query#setBoost` and `Query#getBoost` which made queries effectively immutable. Those methods need to be replaced with `BoostQuery` that wraps any query that needs boosting.\r\n\r\nThis commit replaces usages of `setBoost` with `BoostQuery`.\r\n\r\nUsages of `getBoost` are only partially removed, as some will have to stay for backwards compatibility.\r\n\r\nThere are a few nocommits in the code, mainly questions for reviewers, that is why the PR is marked WIP.","created_at":"2015-10-23T13:20:15Z","updated_at":"2015-10-28T16:23:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc4e57c67f0551774c4a3c58b5690c2f6ed8a6d4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/14264/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/14264/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/14264/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/65891223005393fada69e72755f68d0ea4437a0e","head":{"label":"javanna:enhancement/move_to_boost_query","ref":"enhancement/move_to_boost_query","sha":"65891223005393fada69e72755f68d0ea4437a0e","user":{"login":"javanna","id":832460,"avatar_url":"https://avatars.githubusercontent.com/u/832460?v=3","gravatar_id":"","url":"https://api.github.com/users/javanna","html_url":"https://github.com/javanna","followers_url":"https://api.github.com/users/javanna/followers","following_url":"https://api.github.com/users/javanna/following{/other_user}","gists_url":"https://api.github.com/users/javanna/gists{/gist_id}","starred_url":"https://api.github.com/users/javanna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javanna/subscriptions","organizations_url":"https://api.github.com/users/javanna/orgs","repos_url":"https://api.github.com/users/javanna/repos","events_url":"https://api.github.com/users/javanna/events{/privacy}","received_events_url":"https://api.github.com/users/javanna/received_events","type":"User","site_admin":false},"repo":{"id":6652220,"name":"elasticsearch","full_name":"javanna/elasticsearch","owner":{"login":"javanna","id":832460,"avatar_url":"https://avatars.githubusercontent.com/u/832460?v=3","gravatar_id":"","url":"https://api.github.com/users/javanna","html_url":"https://github.com/javanna","followers_url":"https://api.github.com/users/javanna/followers","following_url":"https://api.github.com/users/javanna/following{/other_user}","gists_url":"https://api.github.com/users/javanna/gists{/gist_id}","starred_url":"https://api.github.com/users/javanna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javanna/subscriptions","organizations_url":"https://api.github.com/users/javanna/orgs","repos_url":"https://api.github.com/users/javanna/repos","events_url":"https://api.github.com/users/javanna/events{/privacy}","received_events_url":"https://api.github.com/users/javanna/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/javanna/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/javanna/elasticsearch","forks_url":"https://api.github.com/repos/javanna/elasticsearch/forks","keys_url":"https://api.github.com/repos/javanna/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/javanna/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/javanna/elasticsearch/teams","hooks_url":"https://api.github.com/repos/javanna/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/javanna/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/javanna/elasticsearch/events","assignees_url":"https://api.github.com/repos/javanna/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/javanna/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/javanna/elasticsearch/tags","blobs_url":"https://api.github.com/repos/javanna/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/javanna/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/javanna/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/javanna/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/javanna/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/javanna/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/javanna/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/javanna/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/javanna/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/javanna/elasticsearch/subscription","commits_url":"https://api.github.com/repos/javanna/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/javanna/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/javanna/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/javanna/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/javanna/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/javanna/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/javanna/elasticsearch/merges","archive_url":"https://api.github.com/repos/javanna/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/javanna/elasticsearch/downloads","issues_url":"https://api.github.com/repos/javanna/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/javanna/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/javanna/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/javanna/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/javanna/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/javanna/elasticsearch/releases{/id}","created_at":"2012-11-12T11:11:09Z","updated_at":"2015-04-30T08:59:29Z","pushed_at":"2015-10-28T14:44:33Z","git_url":"git://github.com/javanna/elasticsearch.git","ssh_url":"git@github.com:javanna/elasticsearch.git","clone_url":"https://github.com/javanna/elasticsearch.git","svn_url":"https://github.com/javanna/elasticsearch","homepage":"http://elasticsearch.org","size":167715,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"e7294322af8be5286df572612914b344f2a56ddc","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"name":"elasticsearch","full_name":"elastic/elasticsearch","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elastic/elasticsearch","forks_url":"https://api.github.com/repos/elastic/elasticsearch/forks","keys_url":"https://api.github.com/repos/elastic/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elastic/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/elasticsearch/events","assignees_url":"https://api.github.com/repos/elastic/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elastic/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elastic/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elastic/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elastic/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elastic/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elastic/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/elasticsearch/merges","archive_url":"https://api.github.com/repos/elastic/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elastic/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elastic/elasticsearch/releases{/id}","created_at":"2010-02-08T13:20:56Z","updated_at":"2015-10-28T16:22:52Z","pushed_at":"2015-10-28T15:57:28Z","git_url":"git://github.com/elastic/elasticsearch.git","ssh_url":"git@github.com:elastic/elasticsearch.git","clone_url":"https://github.com/elastic/elasticsearch.git","svn_url":"https://github.com/elastic/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":478626,"stargazers_count":13279,"watchers_count":13279,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4359,"mirror_url":null,"open_issues_count":1249,"forks":4359,"open_issues":1249,"watchers":13279,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/14264"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/14264"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/14264"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/14264/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/14264/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/14264/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/65891223005393fada69e72755f68d0ea4437a0e"}}}}