Hello,
I'd like to know if the "script query" can be used with the rollup searchs.
I had the following query that works ok using a normal _search on a normal index:
GET index/_search
{
"size": 0,
"aggs": {
"daily": {
"date_histogram": {
"field": "timestamp",
"interval": "24h"
},
"aggs": {
"operations": {
"terms": {
"script": {
"id": "request_operation_types",
"params": {
"field": "method"
}
}
}
}
}
}
}
}
But it doesn't work using a _rollup_search in a rollup index.
GET rollup_index/_rollup_search
{
"size": 0,
"aggs": {
"daily": {
"date_histogram": {
"field": "timestamp",
"interval": "24h"
},
"aggs": {
"operations": {
"terms": {
"script": {
"id": "request_operation_types",
"params": {
"field": "method"
}
}
}
}
}
}
}
}
I got
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "There is not a rollup job that has a [terms] agg on field [null] which also satisfies all requirements of query."
}
],
"type": "illegal_argument_exception",
"reason": "There is not a rollup job that has a [terms] agg on field [null] which also satisfies all requirements of query."
},
"status": 400
}
Thanks in advance.