Elasticsearch show only the name of all indices with node js
|Added at||2016-12-27 15:12|
I am using ejs framework with node js. I can get all the index names in json format. But what I want is just the names of the indices. My code looks like as follows-
if I use response in callback, I get the following output:
and when I use response.hits.hits in callback I get the error:"cannot read property 'hits' of undefined". I want to show only the index names as a list. FYI, in front end, I passed the response say as "results" :
which shows nothing ofcourse.
I import the module as follows: