Hi,
I'm new to Painless (and to Elasticsearch as well) and I'm building a query that looks like this:
"script_fields": {
"PeriodTime": {
"script": {
"source": "doc['@timestamp'].value.millis - doc['previousStateDateTime'].value.millis",
"lang": "painless"
}
}
},
"stored_fields": [
"*"
],
"_source": {
"excludes": []
},
"query": {
"bool": {
"must": [],
"filter": [
{
"match_all": {}
},
{
"range": {
"@timestamp": {
"gte": "2021-03-23T00:00:00.000Z",
"lte": "2021-03-23T23:59:59.000Z",
"format": "strict_date_optional_time"
}
}
}
],
"should": [],
"must_not": []
}
}
I would like to receive the "gte" and "lte" values inside the source of the scripted field. Is this possible?
Thanks