{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/16870","repository_url":"https://api.github.com/repos/elastic/elasticsearch","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/16870/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/16870/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/16870/events","html_url":"https://github.com/elastic/elasticsearch/pull/16870","id":137334797,"number":16870,"title":"Adds a rewrite phase to queries on the shard level","user":{"login":"colings86","id":236731,"avatar_url":"https://avatars.githubusercontent.com/u/236731?v=3","gravatar_id":"","url":"https://api.github.com/users/colings86","html_url":"https://github.com/colings86","followers_url":"https://api.github.com/users/colings86/followers","following_url":"https://api.github.com/users/colings86/following{/other_user}","gists_url":"https://api.github.com/users/colings86/gists{/gist_id}","starred_url":"https://api.github.com/users/colings86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colings86/subscriptions","organizations_url":"https://api.github.com/users/colings86/orgs","repos_url":"https://api.github.com/users/colings86/repos","events_url":"https://api.github.com/users/colings86/events{/privacy}","received_events_url":"https://api.github.com/users/colings86/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Query%20DSL","name":":Query DSL","color":"009800"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/feature","name":"feature","color":"328a58"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/review","name":"review","color":"0052cc"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/v5.0.0","name":"v5.0.0","color":"dddddd"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-02-29T18:40:38Z","updated_at":"2016-03-16T10:04:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/16870","html_url":"https://github.com/elastic/elasticsearch/pull/16870","diff_url":"https://github.com/elastic/elasticsearch/pull/16870.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/16870.patch"},"body":"This change adds a rewrite phase to the queries on the shard before they are assessed for caching or executed. This allows the opportunity to rewrite queries as faster running simpler queries based on attributes known to only the shard itself. The first query to implement this is the RangeQueryBuilder which will rewrite to a MatchAllQueryBuilder if the range of terms on the shard is a subset of the query and rewrites to a MatchNoneQueryBuilder if the range of terms on the shard is completely outside the query.\r\n\r\nCloses #9526"},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments/197240470","html_url":"https://github.com/elastic/elasticsearch/pull/16870#issuecomment-197240470","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/16870","id":197240470,"user":{"login":"s1monw","id":973334,"avatar_url":"https://avatars.githubusercontent.com/u/973334?v=3","gravatar_id":"","url":"https://api.github.com/users/s1monw","html_url":"https://github.com/s1monw","followers_url":"https://api.github.com/users/s1monw/followers","following_url":"https://api.github.com/users/s1monw/following{/other_user}","gists_url":"https://api.github.com/users/s1monw/gists{/gist_id}","starred_url":"https://api.github.com/users/s1monw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s1monw/subscriptions","organizations_url":"https://api.github.com/users/s1monw/orgs","repos_url":"https://api.github.com/users/s1monw/repos","events_url":"https://api.github.com/users/s1monw/events{/privacy}","received_events_url":"https://api.github.com/users/s1monw/received_events","type":"User","site_admin":false},"created_at":"2016-03-16T10:04:36Z","updated_at":"2016-03-16T10:04:36Z","body":"@colings86 this looks awesome - pretty close, I left some comments"}}