# How to quering long type data

**URL:** <https://discuss.elastic.co/t/how-to-quering-long-type-data/175118>\
**Category:** Elasticsearch\
**Created:** [April 3, 2019, 7:12am UTC](https://discuss.elastic.co/t/how-to-quering-long-type-data/175118 "2019-04-03T07:12:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zarka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zarka/32/43361_2.png) [@zarka](https://discuss.elastic.co/u/zarka)\
**Post date:** [April 3, 2019, 7:12am UTC](https://discuss.elastic.co/t/how-to-quering-long-type-data/175118/1 "2019-04-03T07:12:30Z")

</div>

Hello all,  
I am trying to query to a long type data but its seems that its doesn't work, for example if the number :1.5035830264843164 is set to a long, and i am trying to query that field with the "get" func. its giving me:  
{  
"took": 3,  
"timed\_out": false,  
"\_shards": {  
"total": 5,  
"successful": 5,  
"failed": 0  
},  
"hits": {  
"total": 0,  
"max\_score": null,  
"hits":   
}  
}

Why is that and how can i query long type fields?  
thanks!

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 3, 2019, 7:51am UTC](https://discuss.elastic.co/t/how-to-quering-long-type-data/175118/2 "2019-04-03T07:51:05Z")

</div>

I am not sure I understand the question or the problem. If you store something as a long, why do you want to query it as a float? Also please provide full reproductions, so people can follow your examples more easily, I have no idea what the query you did looked like (an exact query will likely not match, a range query however might have been).

---

<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:** [May 1, 2019, 7:51am UTC](https://discuss.elastic.co/t/how-to-quering-long-type-data/175118/3 "2019-05-01T07:51:05Z")

</div>

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