{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/51700005","id":51700005,"diff_hunk":"@@ -77,31 +82,39 @@ private TokenFilter evaluate(String name, FilterPath[] filters) {\n             }\n \n             if ((nextFilters != null) && (nextFilters.isEmpty() == false)) {\n-                return new FilterPathBasedFilter(nextFilters.toArray(new FilterPath[nextFilters.size()]));\n+                return new FilterPathBasedFilter(inclusive, nextFilters.toArray(new FilterPath[nextFilters.size()]));\n             }\n         }\n         return NO_MATCHING;\n     }\n \n+\n     @Override\n     public TokenFilter includeProperty(String name) {\n-        TokenFilter include = evaluate(name, filters);\n-        if (include == MATCHING) {\n-            return TokenFilter.INCLUDE_ALL;\n-        }\n-        if (include == NO_MATCHING) {\n-            return null;\n+        TokenFilter filter = evaluate(name, filters);\n+        if (inclusive) {\n+            if (filter == MATCHING) {\n+                return TokenFilter.INCLUDE_ALL;\n+            } else if (filter == NO_MATCHING) {\n+                return null;\n+            }\n+        } else {\n+            if (filter == MATCHING) {\n+                return null;\n+            } else if (filter == NO_MATCHING) {\n+                return TokenFilter.INCLUDE_ALL;\n+            }\n         }","path":"core/src/main/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathBasedFilter.java","position":69,"original_position":69,"commit_id":"a0d8d656fc7138f6a4d863beff791084c6dc5196","original_commit_id":"a0d8d656fc7138f6a4d863beff791084c6dc5196","user":{"login":"beiske","id":98256,"avatar_url":"https://avatars.githubusercontent.com/u/98256?v=3","gravatar_id":"","url":"https://api.github.com/users/beiske","html_url":"https://github.com/beiske","followers_url":"https://api.github.com/users/beiske/followers","following_url":"https://api.github.com/users/beiske/following{/other_user}","gists_url":"https://api.github.com/users/beiske/gists{/gist_id}","starred_url":"https://api.github.com/users/beiske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beiske/subscriptions","organizations_url":"https://api.github.com/users/beiske/orgs","repos_url":"https://api.github.com/users/beiske/repos","events_url":"https://api.github.com/users/beiske/events{/privacy}","received_events_url":"https://api.github.com/users/beiske/received_events","type":"User","site_admin":false},"body":"Yeah, I'll agree this time making it more compact makes it easier to see the pattern. I'll change it.\r\n","created_at":"2016-02-03T10:01:08Z","updated_at":"2016-02-03T10:01:08Z","html_url":"https://github.com/elastic/elasticsearch/pull/16017#discussion_r51700005","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/16017","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/51700005"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/16017#discussion_r51700005"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/16017"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/16017","id":56178335,"html_url":"https://github.com/elastic/elasticsearch/pull/16017","diff_url":"https://github.com/elastic/elasticsearch/pull/16017.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/16017.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/16017","number":16017,"state":"open","locked":false,"title":"Add option to exclude based on paths in XContent","user":{"login":"beiske","id":98256,"avatar_url":"https://avatars.githubusercontent.com/u/98256?v=3","gravatar_id":"","url":"https://api.github.com/users/beiske","html_url":"https://github.com/beiske","followers_url":"https://api.github.com/users/beiske/followers","following_url":"https://api.github.com/users/beiske/following{/other_user}","gists_url":"https://api.github.com/users/beiske/gists{/gist_id}","starred_url":"https://api.github.com/users/beiske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beiske/subscriptions","organizations_url":"https://api.github.com/users/beiske/orgs","repos_url":"https://api.github.com/users/beiske/repos","events_url":"https://api.github.com/users/beiske/events{/privacy}","received_events_url":"https://api.github.com/users/beiske/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-15T14:56:41Z","updated_at":"2016-02-03T10:01:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b1c3e7af1603cdab5bfd3accf673b9c0a349d7b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/16017/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/16017/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/16017/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/a0d8d656fc7138f6a4d863beff791084c6dc5196","head":{"label":"beiske:xcontent_exclude","ref":"xcontent_exclude","sha":"a0d8d656fc7138f6a4d863beff791084c6dc5196","user":{"login":"beiske","id":98256,"avatar_url":"https://avatars.githubusercontent.com/u/98256?v=3","gravatar_id":"","url":"https://api.github.com/users/beiske","html_url":"https://github.com/beiske","followers_url":"https://api.github.com/users/beiske/followers","following_url":"https://api.github.com/users/beiske/following{/other_user}","gists_url":"https://api.github.com/users/beiske/gists{/gist_id}","starred_url":"https://api.github.com/users/beiske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beiske/subscriptions","organizations_url":"https://api.github.com/users/beiske/orgs","repos_url":"https://api.github.com/users/beiske/repos","events_url":"https://api.github.com/users/beiske/events{/privacy}","received_events_url":"https://api.github.com/users/beiske/received_events","type":"User","site_admin":false},"repo":{"id":41142990,"name":"elasticsearch","full_name":"beiske/elasticsearch","owner":{"login":"beiske","id":98256,"avatar_url":"https://avatars.githubusercontent.com/u/98256?v=3","gravatar_id":"","url":"https://api.github.com/users/beiske","html_url":"https://github.com/beiske","followers_url":"https://api.github.com/users/beiske/followers","following_url":"https://api.github.com/users/beiske/following{/other_user}","gists_url":"https://api.github.com/users/beiske/gists{/gist_id}","starred_url":"https://api.github.com/users/beiske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beiske/subscriptions","organizations_url":"https://api.github.com/users/beiske/orgs","repos_url":"https://api.github.com/users/beiske/repos","events_url":"https://api.github.com/users/beiske/events{/privacy}","received_events_url":"https://api.github.com/users/beiske/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/beiske/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/beiske/elasticsearch","forks_url":"https://api.github.com/repos/beiske/elasticsearch/forks","keys_url":"https://api.github.com/repos/beiske/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/beiske/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/beiske/elasticsearch/teams","hooks_url":"https://api.github.com/repos/beiske/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/beiske/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/beiske/elasticsearch/events","assignees_url":"https://api.github.com/repos/beiske/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/beiske/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/beiske/elasticsearch/tags","blobs_url":"https://api.github.com/repos/beiske/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/beiske/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/beiske/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/beiske/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/beiske/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/beiske/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/beiske/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/beiske/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/beiske/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/beiske/elasticsearch/subscription","commits_url":"https://api.github.com/repos/beiske/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/beiske/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/beiske/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/beiske/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/beiske/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/beiske/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/beiske/elasticsearch/merges","archive_url":"https://api.github.com/repos/beiske/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/beiske/elasticsearch/downloads","issues_url":"https://api.github.com/repos/beiske/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/beiske/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/beiske/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/beiske/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/beiske/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/beiske/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/beiske/elasticsearch/deployments","created_at":"2015-08-21T07:49:03Z","updated_at":"2015-08-21T07:49:24Z","pushed_at":"2016-02-01T10:26:59Z","git_url":"git://github.com/beiske/elasticsearch.git","ssh_url":"git@github.com:beiske/elasticsearch.git","clone_url":"https://github.com/beiske/elasticsearch.git","svn_url":"https://github.com/beiske/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":172565,"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":"7745c64a625f8d411d0dcd0f808f38043af8d819","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-02-03T09:36:32Z","pushed_at":"2016-02-03T09:59:05Z","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":285287,"stargazers_count":14998,"watchers_count":14998,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4932,"mirror_url":null,"open_issues_count":1123,"forks":4932,"open_issues":1123,"watchers":14998,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/16017"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/16017"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/16017"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/16017/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/16017/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/16017/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/a0d8d656fc7138f6a4d863beff791084c6dc5196"}}}}