Hi all,
I am trying to write a statement like this but in Nest / C# object initializer syntax:
GET /_search
{
"query": {
"bool": {
"filter": {
"script": {
"script": """
double amount = doc['amount'].value;
if (doc['type'].value == 'expense') {
amount *= -1;
}
return amount < 10;
"""
}
}
}
}
}
There are no docs that describe how to set up a multi line script in C# / Nest, from what I've seen the docs only show a basic maths operation without going in to more detail.
If someone could translate the example in the code blocks above (first example in these docs), I would be most grateful.