{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/215042570","pull_request_review_id":152223291,"id":215042570,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNTA0MjU3MA==","diff_hunk":"@@ -127,20 +134,44 @@\n import org.elasticsearch.indices.analysis.PreBuiltCacheFactory.CachingStrategy;\n import org.elasticsearch.plugins.AnalysisPlugin;\n import org.elasticsearch.plugins.Plugin;\n+import org.elasticsearch.plugins.ScriptPlugin;\n+import org.elasticsearch.script.ScriptContext;\n+import org.elasticsearch.script.ScriptService;\n+import org.elasticsearch.threadpool.ThreadPool;\n+import org.elasticsearch.watcher.ResourceWatcherService;\n import org.tartarus.snowball.ext.DutchStemmer;\n import org.tartarus.snowball.ext.FrenchStemmer;\n \n import java.util.ArrayList;\n+import java.util.Collection;\n+import java.util.Collections;\n import java.util.List;\n import java.util.Map;\n import java.util.TreeMap;\n \n import static org.elasticsearch.plugins.AnalysisPlugin.requiresAnalysisSettings;\n \n-public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin {\n+public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, ScriptPlugin {\n \n     private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(Loggers.getLogger(CommonAnalysisPlugin.class));\n \n+    private final SetOnce<ScriptService> scriptService = new SetOnce<>();\n+\n+    @Override\n+    public Collection<Object> createComponents(Client client, ClusterService clusterService, ThreadPool threadPool,\n+                                               ResourceWatcherService resourceWatcherService, ScriptService scriptService,\n+                                               NamedXContentRegistry xContentRegistry, Environment environment,\n+                                               NodeEnvironment nodeEnvironment, NamedWriteableRegistry namedWriteableRegistry) {\n+        this.scriptService.set(scriptService);\n+        return Collections.emptyList();\n+    }\n+\n+    @Override\n+    @SuppressWarnings(\"rawtypes\")  // TODO ScriptPlugin needs to change this to pass precommit?","path":"modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java","position":55,"original_position":55,"commit_id":"396843f5e5d792049500eb2fb938a98be221b5de","original_commit_id":"396843f5e5d792049500eb2fb938a98be221b5de","user":{"login":"nik9000","id":215970,"node_id":"MDQ6VXNlcjIxNTk3MA==","avatar_url":"https://avatars2.githubusercontent.com/u/215970?v=4","gravatar_id":"","url":"https://api.github.com/users/nik9000","html_url":"https://github.com/nik9000","followers_url":"https://api.github.com/users/nik9000/followers","following_url":"https://api.github.com/users/nik9000/following{/other_user}","gists_url":"https://api.github.com/users/nik9000/gists{/gist_id}","starred_url":"https://api.github.com/users/nik9000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nik9000/subscriptions","organizations_url":"https://api.github.com/users/nik9000/orgs","repos_url":"https://api.github.com/users/nik9000/repos","events_url":"https://api.github.com/users/nik9000/events{/privacy}","received_events_url":"https://api.github.com/users/nik9000/received_events","type":"User","site_admin":false},"body":"Did you mean to leave this TODO?","created_at":"2018-09-04T19:42:34Z","updated_at":"2018-09-04T19:43:42Z","html_url":"https://github.com/elastic/elasticsearch/pull/31958#discussion_r215042570","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/31958","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/215042570"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/31958#discussion_r215042570"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/31958"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/31958","id":200663965,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwNjYzOTY1","html_url":"https://github.com/elastic/elasticsearch/pull/31958","diff_url":"https://github.com/elastic/elasticsearch/pull/31958.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/31958.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/31958","number":31958,"state":"open","locked":false,"title":"Add conditional token filter to elasticsearch","user":{"login":"romseygeek","id":1347065,"node_id":"MDQ6VXNlcjEzNDcwNjU=","avatar_url":"https://avatars0.githubusercontent.com/u/1347065?v=4","gravatar_id":"","url":"https://api.github.com/users/romseygeek","html_url":"https://github.com/romseygeek","followers_url":"https://api.github.com/users/romseygeek/followers","following_url":"https://api.github.com/users/romseygeek/following{/other_user}","gists_url":"https://api.github.com/users/romseygeek/gists{/gist_id}","starred_url":"https://api.github.com/users/romseygeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romseygeek/subscriptions","organizations_url":"https://api.github.com/users/romseygeek/orgs","repos_url":"https://api.github.com/users/romseygeek/repos","events_url":"https://api.github.com/users/romseygeek/events{/privacy}","received_events_url":"https://api.github.com/users/romseygeek/received_events","type":"User","site_admin":false},"body":"Lucene has a ConditionTokenFilter which allows you to selectively apply tokenfilters, depending on the state of the current token in the tokenstream.  This commit exposes this functionality in elasticsearch, adding a new AnalysisPredicateScript context.","created_at":"2018-07-11T11:07:09Z","updated_at":"2018-09-04T19:43:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"49c1df8fdb2a82d5c1edb7398a894b1d16b79fc4","assignee":{"login":"romseygeek","id":1347065,"node_id":"MDQ6VXNlcjEzNDcwNjU=","avatar_url":"https://avatars0.githubusercontent.com/u/1347065?v=4","gravatar_id":"","url":"https://api.github.com/users/romseygeek","html_url":"https://github.com/romseygeek","followers_url":"https://api.github.com/users/romseygeek/followers","following_url":"https://api.github.com/users/romseygeek/following{/other_user}","gists_url":"https://api.github.com/users/romseygeek/gists{/gist_id}","starred_url":"https://api.github.com/users/romseygeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romseygeek/subscriptions","organizations_url":"https://api.github.com/users/romseygeek/orgs","repos_url":"https://api.github.com/users/romseygeek/repos","events_url":"https://api.github.com/users/romseygeek/events{/privacy}","received_events_url":"https://api.github.com/users/romseygeek/received_events","type":"User","site_admin":false},"assignees":[{"login":"romseygeek","id":1347065,"node_id":"MDQ6VXNlcjEzNDcwNjU=","avatar_url":"https://avatars0.githubusercontent.com/u/1347065?v=4","gravatar_id":"","url":"https://api.github.com/users/romseygeek","html_url":"https://github.com/romseygeek","followers_url":"https://api.github.com/users/romseygeek/followers","following_url":"https://api.github.com/users/romseygeek/following{/other_user}","gists_url":"https://api.github.com/users/romseygeek/gists{/gist_id}","starred_url":"https://api.github.com/users/romseygeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romseygeek/subscriptions","organizations_url":"https://api.github.com/users/romseygeek/orgs","repos_url":"https://api.github.com/users/romseygeek/repos","events_url":"https://api.github.com/users/romseygeek/events{/privacy}","received_events_url":"https://api.github.com/users/romseygeek/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":142001965,"node_id":"MDU6TGFiZWwxNDIwMDE5NjU=","url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Search/Analysis","name":":Search/Analysis","color":"0e8a16","default":false},{"id":23172,"node_id":"MDU6TGFiZWwyMzE3Mg==","url":"https://api.github.com/repos/elastic/elasticsearch/labels/%3Efeature","name":">feature","color":"006b75","default":false},{"id":962378555,"node_id":"MDU6TGFiZWw5NjIzNzg1NTU=","url":"https://api.github.com/repos/elastic/elasticsearch/labels/v6.5.0","name":"v6.5.0","color":"Dddddd","default":false},{"id":484855464,"node_id":"MDU6TGFiZWw0ODQ4NTU0NjQ=","url":"https://api.github.com/repos/elastic/elasticsearch/labels/v7.0.0","name":"v7.0.0","color":"dddddd","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/31958/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/31958/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/31958/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/396843f5e5d792049500eb2fb938a98be221b5de","head":{"label":"romseygeek:scripted-analysis","ref":"scripted-analysis","sha":"396843f5e5d792049500eb2fb938a98be221b5de","user":{"login":"romseygeek","id":1347065,"node_id":"MDQ6VXNlcjEzNDcwNjU=","avatar_url":"https://avatars0.githubusercontent.com/u/1347065?v=4","gravatar_id":"","url":"https://api.github.com/users/romseygeek","html_url":"https://github.com/romseygeek","followers_url":"https://api.github.com/users/romseygeek/followers","following_url":"https://api.github.com/users/romseygeek/following{/other_user}","gists_url":"https://api.github.com/users/romseygeek/gists{/gist_id}","starred_url":"https://api.github.com/users/romseygeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romseygeek/subscriptions","organizations_url":"https://api.github.com/users/romseygeek/orgs","repos_url":"https://api.github.com/users/romseygeek/repos","events_url":"https://api.github.com/users/romseygeek/events{/privacy}","received_events_url":"https://api.github.com/users/romseygeek/received_events","type":"User","site_admin":false},"repo":{"id":113848208,"node_id":"MDEwOlJlcG9zaXRvcnkxMTM4NDgyMDg=","name":"elasticsearch","full_name":"romseygeek/elasticsearch","owner":{"login":"romseygeek","id":1347065,"node_id":"MDQ6VXNlcjEzNDcwNjU=","avatar_url":"https://avatars0.githubusercontent.com/u/1347065?v=4","gravatar_id":"","url":"https://api.github.com/users/romseygeek","html_url":"https://github.com/romseygeek","followers_url":"https://api.github.com/users/romseygeek/followers","following_url":"https://api.github.com/users/romseygeek/following{/other_user}","gists_url":"https://api.github.com/users/romseygeek/gists{/gist_id}","starred_url":"https://api.github.com/users/romseygeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romseygeek/subscriptions","organizations_url":"https://api.github.com/users/romseygeek/orgs","repos_url":"https://api.github.com/users/romseygeek/repos","events_url":"https://api.github.com/users/romseygeek/events{/privacy}","received_events_url":"https://api.github.com/users/romseygeek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/romseygeek/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/romseygeek/elasticsearch","forks_url":"https://api.github.com/repos/romseygeek/elasticsearch/forks","keys_url":"https://api.github.com/repos/romseygeek/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/romseygeek/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/romseygeek/elasticsearch/teams","hooks_url":"https://api.github.com/repos/romseygeek/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/romseygeek/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/romseygeek/elasticsearch/events","assignees_url":"https://api.github.com/repos/romseygeek/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/romseygeek/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/romseygeek/elasticsearch/tags","blobs_url":"https://api.github.com/repos/romseygeek/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/romseygeek/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/romseygeek/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/romseygeek/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/romseygeek/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/romseygeek/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/romseygeek/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/romseygeek/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/romseygeek/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/romseygeek/elasticsearch/subscription","commits_url":"https://api.github.com/repos/romseygeek/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/romseygeek/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/romseygeek/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/romseygeek/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/romseygeek/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/romseygeek/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/romseygeek/elasticsearch/merges","archive_url":"https://api.github.com/repos/romseygeek/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/romseygeek/elasticsearch/downloads","issues_url":"https://api.github.com/repos/romseygeek/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/romseygeek/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/romseygeek/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/romseygeek/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/romseygeek/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/romseygeek/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/romseygeek/elasticsearch/deployments","created_at":"2017-12-11T10:58:59Z","updated_at":"2017-12-11T10:59:30Z","pushed_at":"2018-08-31T12:01:12Z","git_url":"git://github.com/romseygeek/elasticsearch.git","ssh_url":"git@github.com:romseygeek/elasticsearch.git","clone_url":"https://github.com/romseygeek/elasticsearch.git","svn_url":"https://github.com/romseygeek/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":490337,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"38886e8f23153f69f6d4801dda121cfa352775f9","user":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnk1MDc3NzU=","name":"elasticsearch","full_name":"elastic/elasticsearch","owner":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","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":"2018-09-04T19:37:28Z","pushed_at":"2018-09-04T19:25:38Z","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":509394,"stargazers_count":34064,"watchers_count":34064,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11560,"mirror_url":null,"archived":false,"open_issues_count":1600,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":11560,"open_issues":1600,"watchers":34064,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/31958"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/31958"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/31958"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/31958/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/31958/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/31958/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/396843f5e5d792049500eb2fb938a98be221b5de"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nik9000"}}