# Elasticsearch query returning different value type depending on who makes the request

**URL:** <https://discuss.elastic.co/t/elasticsearch-query-returning-different-value-type-depending-on-who-makes-the-request/142814>\
**Category:** Elasticsearch\
**Created:** [August 2, 2018, 10:23pm UTC](https://discuss.elastic.co/t/elasticsearch-query-returning-different-value-type-depending-on-who-makes-the-request/142814 "2018-08-02T22:23:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![karoline](https://avatars.discourse-cdn.com/v4/letter/k/ba8739/32.png) [@karoline](https://discuss.elastic.co/u/karoline)\
**Post date:** [August 2, 2018, 10:23pm UTC](https://discuss.elastic.co/t/elasticsearch-query-returning-different-value-type-depending-on-who-makes-the-request/142814/1 "2018-08-02T22:23:18Z")

</div>

When I run a query to Elasticsearch using Postman or Kibana, it works as expected.  
The "value" field returns Double values, which makes sense, because they are stored as a Double type.

But when my AWS Lambda Function makes a GET request to Elasticsearch, using the same query as the one used for Postman or Kibana, all the "value" fields return an Integer value instead.

Any thought on why this happen or how can I avoid it?

I'm using the npm elasticsearch package, with the version 15.1.1.

Here is my query:

> <https://gist.github.com/ikenami/bae147aa4621d16e23685fc9eefbc852>

Here is the Postman result ( **The Expected Result, which returns Double values** ):

> <https://gist.github.com/ikenami/2c48ab5eb9c66da189401d66f86bc8ee>

Here is the AWS Lambda result ( **Unwanted Result, which returns Integer values** ):

> <https://gist.github.com/ikenami/c098f106454ca2c2e4214570f88a4bca>

---

<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:** [August 30, 2018, 10:23pm UTC](https://discuss.elastic.co/t/elasticsearch-query-returning-different-value-type-depending-on-who-makes-the-request/142814/2 "2018-08-30T22:23:21Z")

</div>

Closed on August 30, 2018, 10:23pm UTC

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