I have the following query in Elasticsearch:
{
"script_fields": {
"travel_time": {
"script": {
"inline": "doc['DateTo'].value - doc['DateFrom'].value"
}
}
},
"stored_fields": [
"_source"
],
"query": {
"bool": {
"filter": {
"exists": {
"field": "DateTo"
}
}
}
}
}
How can I add DateFrom into exists filter?