Hello,
I'm trying to perform a scripted query:
{
"query": {
"bool": {
"must": [
{
"script": {
"script": "doc['@timestamp'].value.hourOfDay >= params.startHour && doc['@timestamp'].value.hourOfDay <= params.endHour",
"params": {
"startHour": 10,
"endHour": 11
}
}
}
]
}
}
}
But get this error:
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[script] query does not support [params]",
"line": 8,
"col": 23
}
],
"type": "parsing_exception",
"reason": "[script] query does not support [params]",
"line": 8,
"col": 23
},
"status": 400
}
Everything works with hardcoded values:
{
"query": {
"bool": {
"must": [
{
"script": {
"script": "doc['@timestamp'].value.hourOfDay >= 10 && doc['@timestamp'].value.hourOfDay <= 11"
}
}
]
}
}
}
Do you have any clues?
Thanks,
Lorenzo