Problem with script aggregation

Hi all,

I got an exception while trying to use a script aggregation in Kibana using the json input:

I can reproduce the error in Dev Tools when I specify both the field and the script for the same aggregation:

GET online/_search?size=0
{
"aggs": {
"tag": {
"terms": {
"field": "tag.keyword",
"script": {
"source": "doc['tag.keyword']",
"lang": "painless"
}
}
}
}
}

If I remove the field attribute, everything is working perfectly:

GET online/_search?size=0
{
"aggs": {
"tag": {
"terms": {
"script": {
"source": "doc['tag.keyword']",
"lang": "painless"
}
}
}
}
}

But Kibana does not allow me to use JSON input without specifying a field in aggregation.

I am using version 5.6.7.

Thank you for you help,

Aurelien

I installed locally last version of ES and Kibana (7.2) and it is working as expected on this version. So I think best way to solve my issue is to upgrade...

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.