Hi guys,
Is it possible to combine script inline and stored on the same query?
For example, I've got two queries: "Query 1" which calls a stored script and "Query 2" that is a dynamic script inline. How could I combine them in a single statement?
Query 1:
{
"query": {
"script": {
"script": {
"lang": "painless",
"id": "QuarterOfTheYearFilter",
"params": {
"dt_field_name": "MyDate",
"timezone":"UTC",
"reqList": ["02","04"]
}
}
}
}
}
Query 2:
{
"query": {
"script": {
"script": {
"lang": "painless",
"inline": "ZonedDateTime.ofInstant(Instant.ofEpochMilli(doc['MyField'].value), ZoneId.of('{1}')).getDayOfMonth() = '01'"
}
}
}
}
Cheers!