Use of tabifyAggResponse in kibana 6.1.x

(Mauro Michielon) #1

Dear community,

i am trying to make the computed_columns plugin to work under Kibana 6.1.x.

Invoking tabifyAggResponse results into: TypeError: esResponse.hits is undefined

"function tabifyAggResponse(vis, esResponse, respOpts) {
var write = new TabbedAggResponseWriter(vis, respOpts);

var topLevelBucket = _lodash2.default.assign({}, esResponse.aggregations, {

i have tried to use resp directly, but in that way i cannot set respOpts.

any clue?


(Tim Roes) #2


for visualizations we do a precheck if the actually has results. So I think you should add a check to your code, that checks whether resp.hits exists and is not equal 0. If it is, Elasticsearch will just have returned no results, in which case you cannot tabify anything.


(Mauro Michielon) #3

thank you. however, resp object doesn't look to have hits in the first place:

resp property: aggConfig null
resp property: key null
resp property: title null
resp property: tables Array [ {…} ]
resp property: field
resp property: fieldFormatter

is it possible that something has changed in 6.x.x :frowning:

the response in the spy panel is:
"took": 4,
"timed_out": false,
"_shards": {
"total": 15,
"successful": 15,
"skipped": 0,
"failed": 0
"hits": {
"total": 14005,
"max_score": 0,
"hits": []
"status": 200

(Mauro Michielon) #4

in case of unstoppable curiosity :):

(Tim Roes) #5


I've checked your sources. When you register your plugin you don't specify a responseHandler property. In this case the default (tabify) will be used. Meaning the resp you see, is already a tabified response.

You can either set responseHandler: 'none' in your vis registration to get the original ES response, or - more recommended - just use resp as the result of tabify, since you anyway want to tabify it.


(Mauro Michielon) #6

thank you so much!!!

(system) #7

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