Fx. if I take the example from Elasticsearch Reference [7.9] » REST APIs » Search APIs » Search Template and render it I get
POST _render/template
{
"source" : {
"query": { "match" : { "{{my_field}}" : "{{my_value}}" } },
"size" : "{{my_size}}"
},
"params" : {
"my_field" : "message",
"my_value" : "foo",
"my_size" : 5
}
}
Becomes
{
"template_output" : {
"query" : {
"match" : {
"message" : "foo"
}
},
"size" : "5"
}
}
As you can see the INTEGER 5 becomes the string "5".
So document is a bit misleading as it is implied it can handle numeric values.
The only way around this I can think of is to drop working with JSON and turn it into a string (mustache and JSON don't really mix).
Any other options?