{"action":"created","comment":{"url":"https://api.github.com/repos/dotCMS/core/pulls/comments/168538275","pull_request_review_id":96923040,"id":168538275,"diff_hunk":"@@ -1,49 +1,90 @@\n package com.dotcms.elasticsearch.script;\n \n+import java.io.IOException;\n+import org.apache.lucene.index.LeafReaderContext;\n import org.elasticsearch.index.fielddata.ScriptDocValues;\n-import org.elasticsearch.script.AbstractLongSearchScript;\n-import org.elasticsearch.script.ExecutableScript;\n-import org.elasticsearch.script.NativeScriptFactory;\n \n import java.util.List;\n import java.util.Map;\n+import org.elasticsearch.script.ScriptContext;\n+import org.elasticsearch.script.ScriptEngine;\n+import org.elasticsearch.script.SearchScript;\n \n-public class RelationshipSortOrderScriptFactory implements NativeScriptFactory {\n-    \n+\n+public class RelationshipSortOrderScriptFactory implements ScriptEngine {\n     @Override\n-    public ExecutableScript newScript(Map<String, Object> params) {\n-        return new RelationshipSortOrderScript(params.get(\"identifier\").toString(), params.get(\"relName\").toString());\n+    public String getType() {\n+        return \"expert_scripts\";\n     }\n-    \n-    public static class RelationshipSortOrderScript extends AbstractLongSearchScript {\n-        protected final String orderField;\n-        protected final String orderPrefix;\n-        \n-        public RelationshipSortOrderScript(String identifier,String relName) {\n-            orderField=(relName+\"-order\").toLowerCase();\n-            orderPrefix=identifier+\"_\";\n+\n+    @Override\n+    public <T> T compile(String scriptName, String scriptSource, ScriptContext<T> context, Map<String, String> params) {\n+        if (context.equals(SearchScript.CONTEXT) == false) {","path":"dotCMS/src/main/java/com/dotcms/elasticsearch/script/RelationshipSortOrderScriptFactory.java","position":37,"original_position":37,"commit_id":"8cc00e2cceb89a4d182413224806b0f0840f038e","original_commit_id":"8cc00e2cceb89a4d182413224806b0f0840f038e","user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [Avoid unnecessary comparisons in boolean expressions](https://app.codacy.com/app/dotCMS/core/pullRequest?prid=1339639)","created_at":"2018-02-15T16:52:10Z","updated_at":"2018-02-15T16:52:10Z","html_url":"https://github.com/dotCMS/core/pull/13648#discussion_r168538275","pull_request_url":"https://api.github.com/repos/dotCMS/core/pulls/13648","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/dotCMS/core/pulls/comments/168538275"},"html":{"href":"https://github.com/dotCMS/core/pull/13648#discussion_r168538275"},"pull_request":{"href":"https://api.github.com/repos/dotCMS/core/pulls/13648"}}},"pull_request":{"url":"https://api.github.com/repos/dotCMS/core/pulls/13648","id":169414788,"html_url":"https://github.com/dotCMS/core/pull/13648","diff_url":"https://github.com/dotCMS/core/pull/13648.diff","patch_url":"https://github.com/dotCMS/core/pull/13648.patch","issue_url":"https://api.github.com/repos/dotCMS/core/issues/13648","number":13648,"state":"open","locked":false,"title":"Issue 13127 Upgrade to ES 6.1.3","user":{"login":"nollymar","id":8741395,"avatar_url":"https://avatars0.githubusercontent.com/u/8741395?v=4","gravatar_id":"","url":"https://api.github.com/users/nollymar","html_url":"https://github.com/nollymar","followers_url":"https://api.github.com/users/nollymar/followers","following_url":"https://api.github.com/users/nollymar/following{/other_user}","gists_url":"https://api.github.com/users/nollymar/gists{/gist_id}","starred_url":"https://api.github.com/users/nollymar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nollymar/subscriptions","organizations_url":"https://api.github.com/users/nollymar/orgs","repos_url":"https://api.github.com/users/nollymar/repos","events_url":"https://api.github.com/users/nollymar/events{/privacy}","received_events_url":"https://api.github.com/users/nollymar/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-15T16:11:01Z","updated_at":"2018-02-15T16:52:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60829e877435abf273467a5b42629fa9b2c9afb9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotCMS/core/pulls/13648/commits","review_comments_url":"https://api.github.com/repos/dotCMS/core/pulls/13648/comments","review_comment_url":"https://api.github.com/repos/dotCMS/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotCMS/core/issues/13648/comments","statuses_url":"https://api.github.com/repos/dotCMS/core/statuses/8cc00e2cceb89a4d182413224806b0f0840f038e","head":{"label":"dotCMS:issue-13127","ref":"issue-13127","sha":"8cc00e2cceb89a4d182413224806b0f0840f038e","user":{"login":"dotCMS","id":1005263,"avatar_url":"https://avatars3.githubusercontent.com/u/1005263?v=4","gravatar_id":"","url":"https://api.github.com/users/dotCMS","html_url":"https://github.com/dotCMS","followers_url":"https://api.github.com/users/dotCMS/followers","following_url":"https://api.github.com/users/dotCMS/following{/other_user}","gists_url":"https://api.github.com/users/dotCMS/gists{/gist_id}","starred_url":"https://api.github.com/users/dotCMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotCMS/subscriptions","organizations_url":"https://api.github.com/users/dotCMS/orgs","repos_url":"https://api.github.com/users/dotCMS/repos","events_url":"https://api.github.com/users/dotCMS/events{/privacy}","received_events_url":"https://api.github.com/users/dotCMS/received_events","type":"Organization","site_admin":false},"repo":{"id":3729629,"name":"core","full_name":"dotCMS/core","owner":{"login":"dotCMS","id":1005263,"avatar_url":"https://avatars3.githubusercontent.com/u/1005263?v=4","gravatar_id":"","url":"https://api.github.com/users/dotCMS","html_url":"https://github.com/dotCMS","followers_url":"https://api.github.com/users/dotCMS/followers","following_url":"https://api.github.com/users/dotCMS/following{/other_user}","gists_url":"https://api.github.com/users/dotCMS/gists{/gist_id}","starred_url":"https://api.github.com/users/dotCMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotCMS/subscriptions","organizations_url":"https://api.github.com/users/dotCMS/orgs","repos_url":"https://api.github.com/users/dotCMS/repos","events_url":"https://api.github.com/users/dotCMS/events{/privacy}","received_events_url":"https://api.github.com/users/dotCMS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotCMS/core","description":"Source Code for dotCMS Java Enterprise Content Management System","fork":false,"url":"https://api.github.com/repos/dotCMS/core","forks_url":"https://api.github.com/repos/dotCMS/core/forks","keys_url":"https://api.github.com/repos/dotCMS/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotCMS/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotCMS/core/teams","hooks_url":"https://api.github.com/repos/dotCMS/core/hooks","issue_events_url":"https://api.github.com/repos/dotCMS/core/issues/events{/number}","events_url":"https://api.github.com/repos/dotCMS/core/events","assignees_url":"https://api.github.com/repos/dotCMS/core/assignees{/user}","branches_url":"https://api.github.com/repos/dotCMS/core/branches{/branch}","tags_url":"https://api.github.com/repos/dotCMS/core/tags","blobs_url":"https://api.github.com/repos/dotCMS/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotCMS/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotCMS/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotCMS/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotCMS/core/statuses/{sha}","languages_url":"https://api.github.com/repos/dotCMS/core/languages","stargazers_url":"https://api.github.com/repos/dotCMS/core/stargazers","contributors_url":"https://api.github.com/repos/dotCMS/core/contributors","subscribers_url":"https://api.github.com/repos/dotCMS/core/subscribers","subscription_url":"https://api.github.com/repos/dotCMS/core/subscription","commits_url":"https://api.github.com/repos/dotCMS/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotCMS/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotCMS/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotCMS/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotCMS/core/contents/{+path}","compare_url":"https://api.github.com/repos/dotCMS/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotCMS/core/merges","archive_url":"https://api.github.com/repos/dotCMS/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotCMS/core/downloads","issues_url":"https://api.github.com/repos/dotCMS/core/issues{/number}","pulls_url":"https://api.github.com/repos/dotCMS/core/pulls{/number}","milestones_url":"https://api.github.com/repos/dotCMS/core/milestones{/number}","notifications_url":"https://api.github.com/repos/dotCMS/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotCMS/core/labels{/name}","releases_url":"https://api.github.com/repos/dotCMS/core/releases{/id}","deployments_url":"https://api.github.com/repos/dotCMS/core/deployments","created_at":"2012-03-15T15:24:14Z","updated_at":"2018-02-12T07:35:18Z","pushed_at":"2018-02-15T16:16:58Z","git_url":"git://github.com/dotCMS/core.git","ssh_url":"git@github.com:dotCMS/core.git","clone_url":"https://github.com/dotCMS/core.git","svn_url":"https://github.com/dotCMS/core","homepage":"http://dotcms.com","size":298752,"stargazers_count":354,"watchers_count":354,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":312,"mirror_url":null,"archived":false,"open_issues_count":1800,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":312,"open_issues":1800,"watchers":354,"default_branch":"master"}},"base":{"label":"dotCMS:master","ref":"master","sha":"56cd890f2a848e2d8b4a0f4d6e187ed1aa57814b","user":{"login":"dotCMS","id":1005263,"avatar_url":"https://avatars3.githubusercontent.com/u/1005263?v=4","gravatar_id":"","url":"https://api.github.com/users/dotCMS","html_url":"https://github.com/dotCMS","followers_url":"https://api.github.com/users/dotCMS/followers","following_url":"https://api.github.com/users/dotCMS/following{/other_user}","gists_url":"https://api.github.com/users/dotCMS/gists{/gist_id}","starred_url":"https://api.github.com/users/dotCMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotCMS/subscriptions","organizations_url":"https://api.github.com/users/dotCMS/orgs","repos_url":"https://api.github.com/users/dotCMS/repos","events_url":"https://api.github.com/users/dotCMS/events{/privacy}","received_events_url":"https://api.github.com/users/dotCMS/received_events","type":"Organization","site_admin":false},"repo":{"id":3729629,"name":"core","full_name":"dotCMS/core","owner":{"login":"dotCMS","id":1005263,"avatar_url":"https://avatars3.githubusercontent.com/u/1005263?v=4","gravatar_id":"","url":"https://api.github.com/users/dotCMS","html_url":"https://github.com/dotCMS","followers_url":"https://api.github.com/users/dotCMS/followers","following_url":"https://api.github.com/users/dotCMS/following{/other_user}","gists_url":"https://api.github.com/users/dotCMS/gists{/gist_id}","starred_url":"https://api.github.com/users/dotCMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotCMS/subscriptions","organizations_url":"https://api.github.com/users/dotCMS/orgs","repos_url":"https://api.github.com/users/dotCMS/repos","events_url":"https://api.github.com/users/dotCMS/events{/privacy}","received_events_url":"https://api.github.com/users/dotCMS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotCMS/core","description":"Source Code for dotCMS Java Enterprise Content Management System","fork":false,"url":"https://api.github.com/repos/dotCMS/core","forks_url":"https://api.github.com/repos/dotCMS/core/forks","keys_url":"https://api.github.com/repos/dotCMS/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotCMS/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotCMS/core/teams","hooks_url":"https://api.github.com/repos/dotCMS/core/hooks","issue_events_url":"https://api.github.com/repos/dotCMS/core/issues/events{/number}","events_url":"https://api.github.com/repos/dotCMS/core/events","assignees_url":"https://api.github.com/repos/dotCMS/core/assignees{/user}","branches_url":"https://api.github.com/repos/dotCMS/core/branches{/branch}","tags_url":"https://api.github.com/repos/dotCMS/core/tags","blobs_url":"https://api.github.com/repos/dotCMS/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotCMS/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotCMS/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotCMS/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotCMS/core/statuses/{sha}","languages_url":"https://api.github.com/repos/dotCMS/core/languages","stargazers_url":"https://api.github.com/repos/dotCMS/core/stargazers","contributors_url":"https://api.github.com/repos/dotCMS/core/contributors","subscribers_url":"https://api.github.com/repos/dotCMS/core/subscribers","subscription_url":"https://api.github.com/repos/dotCMS/core/subscription","commits_url":"https://api.github.com/repos/dotCMS/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotCMS/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotCMS/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotCMS/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotCMS/core/contents/{+path}","compare_url":"https://api.github.com/repos/dotCMS/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotCMS/core/merges","archive_url":"https://api.github.com/repos/dotCMS/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotCMS/core/downloads","issues_url":"https://api.github.com/repos/dotCMS/core/issues{/number}","pulls_url":"https://api.github.com/repos/dotCMS/core/pulls{/number}","milestones_url":"https://api.github.com/repos/dotCMS/core/milestones{/number}","notifications_url":"https://api.github.com/repos/dotCMS/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotCMS/core/labels{/name}","releases_url":"https://api.github.com/repos/dotCMS/core/releases{/id}","deployments_url":"https://api.github.com/repos/dotCMS/core/deployments","created_at":"2012-03-15T15:24:14Z","updated_at":"2018-02-12T07:35:18Z","pushed_at":"2018-02-15T16:16:58Z","git_url":"git://github.com/dotCMS/core.git","ssh_url":"git@github.com:dotCMS/core.git","clone_url":"https://github.com/dotCMS/core.git","svn_url":"https://github.com/dotCMS/core","homepage":"http://dotcms.com","size":298752,"stargazers_count":354,"watchers_count":354,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":312,"mirror_url":null,"archived":false,"open_issues_count":1800,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":312,"open_issues":1800,"watchers":354,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotCMS/core/pulls/13648"},"html":{"href":"https://github.com/dotCMS/core/pull/13648"},"issue":{"href":"https://api.github.com/repos/dotCMS/core/issues/13648"},"comments":{"href":"https://api.github.com/repos/dotCMS/core/issues/13648/comments"},"review_comments":{"href":"https://api.github.com/repos/dotCMS/core/pulls/13648/comments"},"review_comment":{"href":"https://api.github.com/repos/dotCMS/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotCMS/core/pulls/13648/commits"},"statuses":{"href":"https://api.github.com/repos/dotCMS/core/statuses/8cc00e2cceb89a4d182413224806b0f0840f038e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"codacy-bot"}}