Viewing documents on per weekday classification? My data is in a format like this:
{\"text\": \"hi\",\"created_at\": \"2016-02-21T18:30:36.000Z\"}
To use a script in an aggregation the script
value is not a string but another object. I think you also need to specify lang
alongside file
.
"aggs": {
"byDays": {
"terms": {
"script": {
"lang": "groovy",
"file": "dateConversion",
"params": {
"date_field": "created_at",
"format": "EEEEEE"
}
}
}
}
}
Some parts of my code need some modifications
{
"aggs": {
"byDays": {
"terms": {
"script":{
"file":"test",
"params": {
"date_field": "created_at",
"format": "EEEEEE"
}
}
}
}
}
}
And also my test.groovy code too
Date date = new Date(doc[date_field].value);
date.format(format);