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

**URL:** <https://discuss.elastic.co/t/where-does-elasticsearch-jquery-js-sends-back-search-requests-answer/138124>\
**Category:** Elasticsearch\
**Created:** [July 2, 2018, 6:50am UTC](https://discuss.elastic.co/t/where-does-elasticsearch-jquery-js-sends-back-search-requests-answer/138124 "2018-07-02T06:50:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rs123](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@rs123](https://discuss.elastic.co/u/rs123)\
**Post date:** [July 2, 2018, 6:50am UTC](https://discuss.elastic.co/t/where-does-elasticsearch-jquery-js-sends-back-search-requests-answer/138124/1 "2018-07-02T06:50:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 30, 2018, 6:58am UTC](https://discuss.elastic.co/t/where-does-elasticsearch-jquery-js-sends-back-search-requests-answer/138124/2 "2018-07-30T06:58:42Z")

</div>

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