I'm running a local instance of Elasticsearch, and trying to work with 'painless' under scripted_fields. I can write a single line of script code just fine, but when I use triple-quotes (which is supported as per documentation) to create a multi-line script, it gives me this strange parsing error.
Running a single-line of script works fine:
{
"script_fields": {
"scripted": {
"script": {
"lang": "painless",
"source": "0"
}
}
}
}
With this result (expected) in each entity returned in results:
"fields" : {
"scripted" : [
0
]
}
But using multi-line format:
{
"script_fields": {
"scripted": {
"script": {
"lang": "painless",
"source":
"""
0
"""
}
}
}
}
Gives me this error:
Unexpected character ('\"' (code 34)): was expecting comma to separate Object entries\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@56e69b76; line: 7, column: 12]
Any ideas?