{"action":"created","issue":{"url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/issues/155","repository_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql","labels_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/issues/155/comments","events_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/issues/155/events","html_url":"https://github.com/NLPchina/elasticsearch-sql/issues/155","id":132787637,"number":155,"title":"replace function is not working","user":{"login":"ppamulapati","id":13459530,"avatar_url":"https://avatars.githubusercontent.com/u/13459530?v=3","gravatar_id":"","url":"https://api.github.com/users/ppamulapati","html_url":"https://github.com/ppamulapati","followers_url":"https://api.github.com/users/ppamulapati/followers","following_url":"https://api.github.com/users/ppamulapati/following{/other_user}","gists_url":"https://api.github.com/users/ppamulapati/gists{/gist_id}","starred_url":"https://api.github.com/users/ppamulapati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppamulapati/subscriptions","organizations_url":"https://api.github.com/users/ppamulapati/orgs","repos_url":"https://api.github.com/users/ppamulapati/repos","events_url":"https://api.github.com/users/ppamulapati/events{/privacy}","received_events_url":"https://api.github.com/users/ppamulapati/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-10T18:57:08Z","updated_at":"2016-02-12T13:43:24Z","closed_at":null,"body":"we try to replace a string value in 'message' field. It is not working. \r\n\r\nElasticSearch Ver :2.1.0\r\n\r\nSELECT REPLACE(message,\"MSDW_WOOJ_ALGO_SWP\",\"TESTNAME\"),\r\n       FROM DISCFIX where FIXTags.11 = 'Y2VMB7FHKNB' \r\nand FIXTags.17 = 'zVcKuLJ4SASj66a-jakP9gA'"},"comment":{"url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/issues/comments/183334715","html_url":"https://github.com/NLPchina/elasticsearch-sql/issues/155#issuecomment-183334715","issue_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/issues/155","id":183334715,"user":{"login":"eliranmoyal","id":2933669,"avatar_url":"https://avatars.githubusercontent.com/u/2933669?v=3","gravatar_id":"","url":"https://api.github.com/users/eliranmoyal","html_url":"https://github.com/eliranmoyal","followers_url":"https://api.github.com/users/eliranmoyal/followers","following_url":"https://api.github.com/users/eliranmoyal/following{/other_user}","gists_url":"https://api.github.com/users/eliranmoyal/gists{/gist_id}","starred_url":"https://api.github.com/users/eliranmoyal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliranmoyal/subscriptions","organizations_url":"https://api.github.com/users/eliranmoyal/orgs","repos_url":"https://api.github.com/users/eliranmoyal/repos","events_url":"https://api.github.com/users/eliranmoyal/events{/privacy}","received_events_url":"https://api.github.com/users/eliranmoyal/received_events","type":"User","site_admin":false},"created_at":"2016-02-12T13:43:24Z","updated_at":"2016-02-12T13:43:24Z","body":"what is the replace function? I don't think elasticsearch has this kind of functionality\r\nbut you can always create a script field\r\n```sql\r\nSELECT message, script('replaced_field','doc[\"message\"].value.replace(\"MSDW_WOOJ_ALGO_SWP\",\"TESTNAME\")'\r\nFROM DISCFIX where FIXTags.11 = 'Y2VMB7FHKNB' \r\nand FIXTags.17 = 'zVcKuLJ4SASj66a-jakP9gA'\r\n```"}}