Where does elasticsearch.jquery.js sends back search request's answer?


(radhe) #1

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);
    });
}

(system) #2

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