I want to store data from user index's documents to an array, How?
function newAutocomplete(){
var client = new $.es.Client({
hosts: 'localhost:9200'
});
const response = client.search({
index: 'user',
body: {
query:{
match_all: {}
}
}
}).then(function (resp) {
var hits = resp.hits.hits;
}, function (err) {
console.trace(err.message);
});
}