{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/91945168","pull_request_review_id":12453781,"id":91945168,"diff_hunk":"@@ -150,7 +166,12 @@ public Query rewrite(IndexReader reader) throws IOException {\n             }\n         }\n         if (terms.isEmpty()) {\n-            return Queries.newMatchNoDocsQuery(\"No terms supplied for \" + MultiPhrasePrefixQuery.class.getName());\n+            // if the terms does not exist we could return a MatchNoDocsQuery but this would break the unified highlighter\n+            // which rewrites query with an empty reader.\n+            return new BooleanQuery.Builder()\n+                .add(query.build(), BooleanClause.Occur.MUST)\n+                .add(Queries.newMatchNoDocsQuery(\"No terms supplied for \" + MultiPhrasePrefixQuery.class.getName()),\n+                    BooleanClause.Occur.MUST).build();","path":"core/src/main/java/org/elasticsearch/common/lucene/search/MultiPhrasePrefixQuery.java","position":40,"original_position":40,"commit_id":"3aeb146446de387e64e23fe72bbcb17c6c985063","original_commit_id":"3aeb146446de387e64e23fe72bbcb17c6c985063","user":{"login":"jimczi","id":15977469,"avatar_url":"https://avatars.githubusercontent.com/u/15977469?v=3","gravatar_id":"","url":"https://api.github.com/users/jimczi","html_url":"https://github.com/jimczi","followers_url":"https://api.github.com/users/jimczi/followers","following_url":"https://api.github.com/users/jimczi/following{/other_user}","gists_url":"https://api.github.com/users/jimczi/gists{/gist_id}","starred_url":"https://api.github.com/users/jimczi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimczi/subscriptions","organizations_url":"https://api.github.com/users/jimczi/orgs","repos_url":"https://api.github.com/users/jimczi/repos","events_url":"https://api.github.com/users/jimczi/events{/privacy}","received_events_url":"https://api.github.com/users/jimczi/received_events","type":"User","site_admin":false},"body":"Same here, we return a query that returns no result but extractTerms will return the terms that are already expanded.","created_at":"2016-12-12T13:25:00Z","updated_at":"2016-12-12T13:25:00Z","html_url":"https://github.com/elastic/elasticsearch/pull/21621#discussion_r91945168","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/21621","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/91945168"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/21621#discussion_r91945168"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/21621"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/21621","id":94157103,"html_url":"https://github.com/elastic/elasticsearch/pull/21621","diff_url":"https://github.com/elastic/elasticsearch/pull/21621.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/21621.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/21621","number":21621,"state":"open","locked":false,"title":"Integrate UnifiedHighlighter","user":{"login":"jimczi","id":15977469,"avatar_url":"https://avatars.githubusercontent.com/u/15977469?v=3","gravatar_id":"","url":"https://api.github.com/users/jimczi","html_url":"https://github.com/jimczi","followers_url":"https://api.github.com/users/jimczi/followers","following_url":"https://api.github.com/users/jimczi/following{/other_user}","gists_url":"https://api.github.com/users/jimczi/gists{/gist_id}","starred_url":"https://api.github.com/users/jimczi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimczi/subscriptions","organizations_url":"https://api.github.com/users/jimczi/orgs","repos_url":"https://api.github.com/users/jimczi/repos","events_url":"https://api.github.com/users/jimczi/events{/privacy}","received_events_url":"https://api.github.com/users/jimczi/received_events","type":"User","site_admin":false},"body":"This change integrates the Lucene highlighter called \"unified\" in the list of supported highlighters for ES.\r\nThis highlighter has multiple modes:\r\n  * plain: a mode that analyzes the plain text directly\r\n  * postings: a mode that uses the postings offsets to perform the highlight\r\n  * fvh: a mode that uses the term vectors to perform the highlighting\r\n\r\nSince this is a \"unified\" highlighter here is the complete list of highlighting features supported or not by this integration:\r\n\r\n- [x] works on fields with `term_vectors`, `offsets` or simply`stored`(or extracted from _source).\r\n- [x] `force_source` \r\n- [x] `pre_tags` and `post_tags`\r\nMultiple tags are not allowed\r\n- [x] `encoder` (html and default)\r\n- [x] `number_of_fragments`\r\n- [x] `no_match_size`\r\n- [ ] `require_field_match`\r\nRequires http://issues.apache.org/jira/browse/LUCENE-7575\r\n- [ ] `merged_fields` \r\nSimilar to `require_field_match` but applied to a list of field names\r\n- [ ] `fragment_size ` \r\nRequires http://issues.apache.org/jira/browse/LUCENE-7565\r\n- [ ] `boundary_chars`\r\n- [ ] `boundary_max_scan`\r\n- [ ] Queries with rewrite that needs an index reader are ignored (MultiPhrasePrefixQuery, CommonTermsQuery, AllFieldQuery, ...).\r\n- [ ] Collapse contiguous highlights: `<b>a</b><b>b</b><b>c</b>` => `<b>abc</b>`\r\n\r\nFixes #21376","created_at":"2016-11-17T12:22:07Z","updated_at":"2016-12-12T13:25:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"11e38881dfd0a86fd1a5eb86f61ec19deb25ee29","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/21621/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/21621/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/21621/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/3aeb146446de387e64e23fe72bbcb17c6c985063","head":{"label":"jimczi:unified_highlighter","ref":"unified_highlighter","sha":"3aeb146446de387e64e23fe72bbcb17c6c985063","user":{"login":"jimczi","id":15977469,"avatar_url":"https://avatars.githubusercontent.com/u/15977469?v=3","gravatar_id":"","url":"https://api.github.com/users/jimczi","html_url":"https://github.com/jimczi","followers_url":"https://api.github.com/users/jimczi/followers","following_url":"https://api.github.com/users/jimczi/following{/other_user}","gists_url":"https://api.github.com/users/jimczi/gists{/gist_id}","starred_url":"https://api.github.com/users/jimczi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimczi/subscriptions","organizations_url":"https://api.github.com/users/jimczi/orgs","repos_url":"https://api.github.com/users/jimczi/repos","events_url":"https://api.github.com/users/jimczi/events{/privacy}","received_events_url":"https://api.github.com/users/jimczi/received_events","type":"User","site_admin":false},"repo":{"id":46779835,"name":"elasticsearch","full_name":"jimczi/elasticsearch","owner":{"login":"jimczi","id":15977469,"avatar_url":"https://avatars.githubusercontent.com/u/15977469?v=3","gravatar_id":"","url":"https://api.github.com/users/jimczi","html_url":"https://github.com/jimczi","followers_url":"https://api.github.com/users/jimczi/followers","following_url":"https://api.github.com/users/jimczi/following{/other_user}","gists_url":"https://api.github.com/users/jimczi/gists{/gist_id}","starred_url":"https://api.github.com/users/jimczi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimczi/subscriptions","organizations_url":"https://api.github.com/users/jimczi/orgs","repos_url":"https://api.github.com/users/jimczi/repos","events_url":"https://api.github.com/users/jimczi/events{/privacy}","received_events_url":"https://api.github.com/users/jimczi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jimczi/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/jimczi/elasticsearch","forks_url":"https://api.github.com/repos/jimczi/elasticsearch/forks","keys_url":"https://api.github.com/repos/jimczi/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jimczi/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jimczi/elasticsearch/teams","hooks_url":"https://api.github.com/repos/jimczi/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/jimczi/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/jimczi/elasticsearch/events","assignees_url":"https://api.github.com/repos/jimczi/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/jimczi/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/jimczi/elasticsearch/tags","blobs_url":"https://api.github.com/repos/jimczi/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jimczi/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jimczi/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/jimczi/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jimczi/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/jimczi/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/jimczi/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/jimczi/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/jimczi/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/jimczi/elasticsearch/subscription","commits_url":"https://api.github.com/repos/jimczi/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/jimczi/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/jimczi/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/jimczi/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/jimczi/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/jimczi/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jimczi/elasticsearch/merges","archive_url":"https://api.github.com/repos/jimczi/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jimczi/elasticsearch/downloads","issues_url":"https://api.github.com/repos/jimczi/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/jimczi/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/jimczi/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/jimczi/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jimczi/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/jimczi/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/jimczi/elasticsearch/deployments","created_at":"2015-11-24T09:08:46Z","updated_at":"2016-01-11T09:19:57Z","pushed_at":"2016-12-12T13:21:42Z","git_url":"git://github.com/jimczi/elasticsearch.git","ssh_url":"git@github.com:jimczi/elasticsearch.git","clone_url":"https://github.com/jimczi/elasticsearch.git","svn_url":"https://github.com/jimczi/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":251818,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"7904028fef08964f5086d84fe56533c057c2677c","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}","deployments_url":"https://api.github.com/repos/elastic/elasticsearch/deployments","created_at":"2010-02-08T13:20:56Z","updated_at":"2016-12-12T11:14:30Z","pushed_at":"2016-12-12T13:21:43Z","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":409768,"stargazers_count":19749,"watchers_count":19749,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6783,"mirror_url":null,"open_issues_count":1193,"forks":6783,"open_issues":1193,"watchers":19749,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/21621"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/21621"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/21621"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/21621/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/21621/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/21621/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/3aeb146446de387e64e23fe72bbcb17c6c985063"}}}}
{"actor":{"display_login":"jimczi"}}