Hi CJ,
Yep, I can see that the field is both 'searchable' and 'aggregatable'...
I tried just returning the value, it just shows a hypen (-) on the 'Discover' screen...
And when I try to 'Visualize', following request and response are presented...
Elasticsearch request body
{
"size": 0,
"query": {
"bool": {
"must": [
{
"query_string": {
"analyze_wildcard": true,
"query": "*"
}
},
{
"range": {
"report.lastUpdateDatetime": {
"gte": 1434158649569,
"lte": 1497317049569,
"format": "epoch_millis"
}
}
}
],
"must_not": []
}
},
"_source": {
"excludes": []
},
"aggs": {
"3": {
"terms": {
"script": {
"inline": "doc['activity.typeCode.keyword'].value;",
"lang": "painless"
},
"size": 20,
"order": {
"_count": "desc"
},
"valueType": "string"
}
}
}
}
Elasticsearch response body
{
"took": 4,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0,
"hits": []
},
"aggregations": {
"3": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": []
}
},
"status": 200
}
No errors btw, but no data returned either.
Can you advise, please?
Thanks