Hi everyone,
I'm new to Elasticsearch and I've been trying to understand why my query is not being cached.
I've read the documentation (Shard request cache settings | Elasticsearch Guide [8.11] | Elastic ) several times but I couldn't find any evidence that queries containing scripts cannot be cached.
Sample request:
GET /my_index/_search?request_cache=true
{
"size": 0,
"aggs": {
"groupByOperator": {
"terms": {
"field": "operator",
"size": 10,
"order": {
"total": "desc"
}
},
"aggs": {
"total": {
"sum": {
"script": {
"source": "return doc['field1'].value + doc['field2'].value;"
}
}
}
}
}
}
}
Any idea?
Thanks.