# ES 5.4.0 Range query return wrong result

**URL:** <https://discuss.elastic.co/t/es-5-4-0-range-query-return-wrong-result/139030>\
**Category:** Elasticsearch\
**Created:** [July 8, 2018, 6:10am UTC](https://discuss.elastic.co/t/es-5-4-0-range-query-return-wrong-result/139030 "2018-07-08T06:10:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shadowinlfie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shadowinlfie/32/33106_2.png) [@shadowinlfie](https://discuss.elastic.co/u/shadowinlfie)\
**Post date:** [July 8, 2018, 6:10am UTC](https://discuss.elastic.co/t/es-5-4-0-range-query-return-wrong-result/139030/1 "2018-07-08T06:10:05Z")

</div>

1. Elasticsearch version 5.4.0

2. JVM 1.8

3. Index mapping:  
{  
"eastmoney": {  
"mappings": {  
"doc": {  
"properties": {  
"content": {  
"type": "keyword",  
"ignore\_above": 20  
},  
"crawlertime": {  
"type": "float"  
},  
"files": {  
"type": "keyword"  
},  
"keyid": {  
"type": "keyword"  
},  
"publishtime": {  
"type": "date",  
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch\_millis"  
},  
"sdb": {  
"type": "keyword"  
},  
"stockcode": {  
"type": "keyword"  
},  
"stockname": {  
"type": "text",  
"analyzer": "my\_ana"  
},  
"tag": {  
"type": "keyword"  
},  
"title": {  
"type": "text",  
"analyzer": "my\_ana"  
},  
"url": {  
"type": "keyword"  
}  
}  
}  
}  
}  
}

4. Query:

}

1. Result:  
{  
"took": 7,  
"timed\_out": false,  
"\_shards": {  
"total": 1,  
"successful": 1,  
"failed": 0  
},  
"hits": {  
"total": 61317,  
"max\_score": null,  
"hits": [  
{  
"\_index": "eastmoney",  
"\_type": "doc",  
"\_id": "AN201807011161506068",  
"\_score": null,  
"\_source": {  
"crawlertime": 1530505047304  
},  
"sort": [  
1530505070000  
]  
},  
{  
"\_index": "eastmoney",  
"\_type": "doc",  
"\_id": "AN201807011161506070",  
"\_score": null,  
"\_source": {  
"crawlertime": 1530505047145  
},  
"sort": [  
1530505070000  
]  
},  
{  
"\_index": "eastmoney",  
"\_type": "doc",  
"\_id": "AN201807011161517275",  
"\_score": null,  
"\_source": {  
"crawlertime": 1530505047593  
},  
"sort": [  
1530505070000  
]  
},  
{  
"\_index": "eastmoney",  
"\_type": "doc",  
"\_id": "AN201807011161517302",  
"\_score": null,  
"\_source": {  
"crawlertime": 1530505047778  
},  
"sort": [  
1530505070000  
]  
},  
{  
"\_index": "eastmoney",  
"\_type": "doc",  
"\_id": "AN201807011161517277",  
"\_score": null,  
"\_source": {  
"crawlertime": 1530505047130  
},  
"sort": [  
1530505070000  
]  
},  
{  
"\_index": "eastmoney",  
"\_type": "doc",  
"\_id": "AN201807011161517198",  
"\_score": null,  
"\_source": {  
"crawlertime": 1530505047107  
},  
"sort": [  
1530505070000  
]  
},  
{  
"\_index": "eastmoney",  
"\_type": "doc",  
"\_id": "AN201807011161517129",  
"\_score": null,  
"\_source": {  
"crawlertime": 1530505047861  
},  
"sort": [  
1530505070000  
]  
},  
{  
"\_index": "eastmoney",  
"\_type": "doc",  
"\_id": "AN201807011161516494",  
"\_score": null,  
"\_source": {  
"crawlertime": 1530505047632  
},  
"sort": [  
1530505070000  
]  
},  
{  
"\_index": "eastmoney",  
"\_type": "doc",  
"\_id": "AN201807011161514068",  
"\_score": null,  
"\_source": {  
"crawlertime": 1530505048875  
},  
"sort": [  
1530505070000  
]  
},  
{  
"\_index": "eastmoney",  
"\_type": "doc",  
"\_id": "AN201807011161514069",  
"\_score": null,  
"\_source": {  
"crawlertime": 1530505048984  
},  
"sort": [  
1530505070000  
]  
}  
]  
}  
}

Query with range on crawlertime, return wrong result, some item in hits with larger crawlertime bug is appened int the response

How can I resolve this problem? Is this a known bugs? Is this bugs resolved in the newest version?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 8, 2018, 6:50am UTC](https://discuss.elastic.co/t/es-5-4-0-range-query-return-wrong-result/139030/2 "2018-07-08T06:50:35Z")

</div>

The problem is that crawlertime is a float.  
Change its type to a long.

---

<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 5, 2018, 6:50am UTC](https://discuss.elastic.co/t/es-5-4-0-range-query-return-wrong-result/139030/3 "2018-08-05T06:50:36Z")

</div>

Closed on August 5, 2018, 6:50am UTC

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