How do I escape special characters in Elastic Search Scripts?
For example: I need to search for a string like "{NY} Albany" or "{CA} San Diego" in my script below:
{
"size": 0,
"aggs": {
"Test": {
"terms": {
"script": {
"source": "if(doc['City'].value == '{NY} Albany'){return 1}"
},
"size": 500000
}
}
}
}