{"action":"created","issue":{"url":"https://api.github.com/repos/sksamuel/elastic4s/issues/1415","repository_url":"https://api.github.com/repos/sksamuel/elastic4s","labels_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/1415/labels{/name}","comments_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/1415/comments","events_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/1415/events","html_url":"https://github.com/sksamuel/elastic4s/issues/1415","id":332213127,"node_id":"MDU6SXNzdWUzMzIyMTMxMjc=","number":1415,"title":"Unable to run script on embedded server","user":{"login":"AlexITC","id":4218436,"node_id":"MDQ6VXNlcjQyMTg0MzY=","avatar_url":"https://avatars3.githubusercontent.com/u/4218436?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexITC","html_url":"https://github.com/AlexITC","followers_url":"https://api.github.com/users/AlexITC/followers","following_url":"https://api.github.com/users/AlexITC/following{/other_user}","gists_url":"https://api.github.com/users/AlexITC/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexITC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexITC/subscriptions","organizations_url":"https://api.github.com/users/AlexITC/orgs","repos_url":"https://api.github.com/users/AlexITC/repos","events_url":"https://api.github.com/users/AlexITC/events{/privacy}","received_events_url":"https://api.github.com/users/AlexITC/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-14T00:45:56Z","updated_at":"2018-12-31T03:38:59Z","closed_at":"2018-12-31T03:38:59Z","author_association":"CONTRIBUTOR","body":"I have a very simple client pointing to an embedded server:\r\n```scala\r\n  val clusterName: String = \"elscluster\"\r\n  val homePath: Path = Files.createTempDirectory(clusterName)\r\n\r\n  val settings = LocalNode.requiredSettings(clusterName, homePath.toAbsolutePath.toString) + (\"http.enabled\" -> \"true\")\r\n  val node = LocalNode(settings)\r\n  val client = node.http(true)\r\n```\r\n\r\nI'm getting an error when trying to write a code involving a script:\r\n\r\nError:\r\n```\r\nLeft(RequestFailure(400,Some({\"error\":{\"root_cause\":[{\"type\":\"remote_transport_exception\",\"reason\":\"[AHC5U2A][127.0.0.1:9301][indices:data/write/update[s]]\"}],\"type\":\"illegal_argument_exception\",\"reason\":\"failed to execute script\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"script_lang not supported [painless]\"}},\"status\":400}),Map(content-type -> application/json; charset=UTF-8, content-length -> 314),ElasticError(illegal_argument_exception,failed to execute script,None,None,None,List(ElasticError(remote_transport_exception,[AHC5U2A][127.0.0.1:9301][indices:data/write/update[s]],None,None,None,null,None)),Some(CausedBy(illegal_argument_exception,script_lang not supported [painless],Map())))))\r\n```\r\n\r\nCode under test:\r\n```scala\r\n  private val UpdateScript =\r\n    \"\"\"\r\n      |if (!ctx._source.containsKey(\"values\")) {\r\n      |  ctx._source.values = []\r\n      |}\r\n      |for (obj in params.new_values) {\r\n      |  ctx._source.values.add(obj)\r\n      |}\r\n    \"\"\".stripMargin.trim\r\n\r\n  def updateWithScript(id: String, patch: List[Map[String, String]]) = {\r\n    client.execute {\r\n      update(id)\r\n          .in(\"sampleindex\" / \"sampletype\")\r\n          .script(\r\n            script(UpdateScript)\r\n                .lang(\"painless\")\r\n                .param(\"new_values\", patch)\r\n          )\r\n    }\r\n  }\r\n```\r\n\r\nThe error message says `script_lang not supported [painless]`, do I need to do anything to support painless scripts in the embedded elasticsearch?\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/sksamuel/elastic4s/issues/comments/450605041","html_url":"https://github.com/sksamuel/elastic4s/issues/1415#issuecomment-450605041","issue_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/1415","id":450605041,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDYwNTA0MQ==","user":{"login":"sksamuel","id":743706,"node_id":"MDQ6VXNlcjc0MzcwNg==","avatar_url":"https://avatars3.githubusercontent.com/u/743706?v=4","gravatar_id":"","url":"https://api.github.com/users/sksamuel","html_url":"https://github.com/sksamuel","followers_url":"https://api.github.com/users/sksamuel/followers","following_url":"https://api.github.com/users/sksamuel/following{/other_user}","gists_url":"https://api.github.com/users/sksamuel/gists{/gist_id}","starred_url":"https://api.github.com/users/sksamuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sksamuel/subscriptions","organizations_url":"https://api.github.com/users/sksamuel/orgs","repos_url":"https://api.github.com/users/sksamuel/repos","events_url":"https://api.github.com/users/sksamuel/events{/privacy}","received_events_url":"https://api.github.com/users/sksamuel/received_events","type":"User","site_admin":false},"created_at":"2018-12-31T03:38:59Z","updated_at":"2018-12-31T03:38:59Z","author_association":"OWNER","body":"embedded is removed in 7.0 onwards.\r\nI'd switch to docker."}}
{"actor":{"display_login":"sksamuel"}}