# \[ElasticSearchJS\] Different results when I execute the same query with the JS API and calling the URL directy

**URL:** <https://discuss.elastic.co/t/elasticsearchjs-different-results-when-i-execute-the-same-query-with-the-js-api-and-calling-the-url-directy/37152>\
**Category:** Elasticsearch\
**Created:** [December 14, 2015, 5:20pm UTC](https://discuss.elastic.co/t/elasticsearchjs-different-results-when-i-execute-the-same-query-with-the-js-api-and-calling-the-url-directy/37152 "2015-12-14T17:20:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BSK](https://avatars.discourse-cdn.com/v4/letter/b/bc8723/32.png) [@BSK](https://discuss.elastic.co/u/BSK)\
**Post date:** [December 14, 2015, 5:20pm UTC](https://discuss.elastic.co/t/elasticsearchjs-different-results-when-i-execute-the-same-query-with-the-js-api-and-calling-the-url-directy/37152/1 "2015-12-14T17:20:08Z")

</div>

Hello everyone,

I'm using a Node JS server. I'm using the elasticsearch JS module. I have have a simple query to do. When my program execute it, I have no results, when I call the query with CURL with the same body, I have the results I need.

**This is my mapping**

![](https://us1.discourse-cdn.com/elastic/original/2X/8/8cb5d06050f2e424ce6c3a4bb07827aac6c2018d.PNG)

You will find attached to this post the query I made with the curl command (you can see I have results) and the log of the ElasticSearch JS module that shows the query it buit.

I can't see the difference. For me it's the same query. I don't understand why I can't get results from my program.

Did someone already has this issue. It would be nice if you can help. Maybe I'm missing configuration or something.

Thank you very much !

**ElastiSearch Trace :**

![](https://us1.discourse-cdn.com/elastic/original/2X/4/409eb8d5650da750a9309f905d4fbc52c03aafeb.png)

**Curl :**

 ![](https://us1.discourse-cdn.com/elastic/original/2X/e/e3b0f85620e05afd614e140578a04edf95b3b74c.png)

---

<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 5, 2017, 11:31pm UTC](https://discuss.elastic.co/t/elasticsearchjs-different-results-when-i-execute-the-same-query-with-the-js-api-and-calling-the-url-directy/37152/2 "2017-07-05T23:31:15Z")

</div>


