# Unable to query hash value generated from (zero-allocation-hashing ) algorithm - from ES 2.3

**URL:** <https://discuss.elastic.co/t/unable-to-query-hash-value-generated-from-zero-allocation-hashing-algorithm-from-es-2-3/139553>\
**Category:** Elasticsearch\
**Created:** [July 11, 2018, 11:56am UTC](https://discuss.elastic.co/t/unable-to-query-hash-value-generated-from-zero-allocation-hashing-algorithm-from-es-2-3/139553 "2018-07-11T11:56:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![subramani.new](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@subramani.new](https://discuss.elastic.co/u/subramani.new)\
**Post date:** [July 11, 2018, 11:56am UTC](https://discuss.elastic.co/t/unable-to-query-hash-value-generated-from-zero-allocation-hashing-algorithm-from-es-2-3/139553/1 "2018-07-11T11:56:04Z")

</div>

I have stored array of hash values in a document but unable to query based on hash. Please help

Here the index details

1. Field name is bids and it stores array of hash values  
{"properties": {"bids":{"type":"long"}}}

2. Sample document

hits: [  
{  
\_index: "myindex",  
\_type: "myinfo",  
\_id: "C18B18",  
\_score: 1,  
\_source: {  
uid:10  
bids: [  
3468197663136215600,  
-9068197663136215600  
]  
}  
}  
]

1. Query

curl -XGET '[http://localhost:9200/myindex/myinfo/\_search?pretty](http://localhost:9200/myindex/myinfo/_search?pretty)' -d'  
{  
"size":1,  
"query": {

"filtered" : {  
"query" : {  
"query\_string" : {  
"query": "( bids:3468197663136215600 )"  
}  
}  
}  
}  
}'

Result I see is

{  
"took" : 5,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 2,  
"successful" : 2,  
"failed" : 0  
},  
"hits" : {  
"total" : 0,  
"max\_score" : null,  
"hits" : []  
}  
}

I should get total =1, but I am seeing total =0.

some one please help me.

---

<div class="post-metadata">

**Author:** ![subramani.new](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@subramani.new](https://discuss.elastic.co/u/subramani.new)\
**Post date:** [July 12, 2018, 8:02am UTC](https://discuss.elastic.co/t/unable-to-query-hash-value-generated-from-zero-allocation-hashing-algorithm-from-es-2-3/139553/2 "2018-07-12T08:02:01Z")

</div>

Found the issue.  
it seems Elastic search trimming the last 2 digit and adding "00"

my original value 3468197663136215679 but ES store as 3468197663136215600

this caused me to not able to query.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 12, 2018, 8:56am UTC](https://discuss.elastic.co/t/unable-to-query-hash-value-generated-from-zero-allocation-hashing-algorithm-from-es-2-3/139553/3 "2018-07-12T08:56:33Z")

</div>

You should be getting exact responses if you instead store them as string in the JSON request as large numbers lose precision in JSON/JavaScript.

---

<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 9, 2018, 8:56am UTC](https://discuss.elastic.co/t/unable-to-query-hash-value-generated-from-zero-allocation-hashing-algorithm-from-es-2-3/139553/4 "2018-08-09T08:56:41Z")

</div>

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