# How to use js to query elasticsearch's data

**URL:** <https://discuss.elastic.co/t/how-to-use-js-to-query-elasticsearchs-data/96902>\
**Category:** Elasticsearch\
**Created:** [August 14, 2017, 5:10am UTC](https://discuss.elastic.co/t/how-to-use-js-to-query-elasticsearchs-data/96902 "2017-08-14T05:10:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eboy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eboy/32/22172_2.png) [@eboy](https://discuss.elastic.co/u/eboy)\
**Post date:** [August 14, 2017, 5:10am UTC](https://discuss.elastic.co/t/how-to-use-js-to-query-elasticsearchs-data/96902/1 "2017-08-14T05:10:22Z")

</div>

Ask, on the use of js to get elasticsearch data problems.  
 ![1](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e92ac8310797fd8e32eee79956e17912cbb2b30.png)  
This is the data that can be obtained, the same sentence, with js $ .get () to obtain the time, the callback function did not receive the return value, how is this going on?

 ![3](https://us1.discourse-cdn.com/elastic/original/3X/8/7/8723ceea132e29fad992feceb30ca1e01b66778a.png) ![2](https://us1.discourse-cdn.com/elastic/original/3X/4/8/483c23ac5ef394f55bc436c513ceb8fd84cd2354.png)

The problem should exist on getFacets.jsx, the other code is fine, this part of the callback function did not get the data, but I do not know what to do now.

If you know how to deal with, please help me, thank you.

---

<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:** [September 11, 2017, 5:10am UTC](https://discuss.elastic.co/t/how-to-use-js-to-query-elasticsearchs-data/96902/2 "2017-09-11T05:10:29Z")

</div>

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