I have values stored in a document in an Elasticsearch index.
I need to do some date manipulation for the values and return the boolean value that will be used in the filter.
The script spans multiple lines, and I cannot get it to work.
I have written other single scripts that work just fine, however I know less than nothing about Groovy and very little about finding Elastic.
Each sample that I can find with the script has one line and only one line.
So basically, how would I take this perfectly valid script
"script": {
"script": "doc['state'].value == 'completed' && doc['lastStateUpdate'].value < doc['dueDate'].value"
}
And turn it into something like
"script": {
"script": "def isCompleted = doc['state'].value == 'completed'
def preSLA = doc['lastStateUpdate'].value < doc['dueDate'].value
return isCompleted && preSLA"
}
, liner , , , , , " " isn .
. , , , , .