# Strange result when using range filter with "out of range" values - possible bug?

**URL:** <https://discuss.elastic.co/t/strange-result-when-using-range-filter-with-out-of-range-values-possible-bug/59226>\
**Category:** Elasticsearch\
**Created:** [August 29, 2016, 7:04pm UTC](https://discuss.elastic.co/t/strange-result-when-using-range-filter-with-out-of-range-values-possible-bug/59226 "2016-08-29T19:04:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmpro](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@mmpro](https://discuss.elastic.co/u/mmpro)\
**Post date:** [August 29, 2016, 7:04pm UTC](https://discuss.elastic.co/t/strange-result-when-using-range-filter-with-out-of-range-values-possible-bug/59226/1 "2016-08-29T19:04:58Z")

</div>

We have a strange outcome when using a range request with a number higher than the the allowed value (by mapping).

Example:

Mapping:

```auto
"duration": {
         "type": "integer"
   }

```

Now let's say all my documents have a duration lower than 1000.

If I know use a query like this

```auto
{
	"query": {
		"bool": {
			 "must": [
					{ "range": {
						"duration": {
							"gte": 900
						}
					}
			}]
		}
	}
}

```

Everything's fine and I'll receive all document with duration \>= 900.

Now if I update the query like so

```auto
{
	"query": {
		"bool": {
			 "must": [
					{ "range": {
						"duration": {
							"gte": 90000000000 
						}
					}
			}]
		}
	}
}

```

The search result now contains ALL documents though it shouldn't match any.

The duration 90000000000 is now an "allowed" integer value (as defined per mapping). However I would expect to receive an empty search result.

Can anyone explain why this happens?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [August 29, 2016, 7:30pm UTC](https://discuss.elastic.co/t/strange-result-when-using-range-filter-with-out-of-range-values-possible-bug/59226/2 "2016-08-29T19:30:17Z")

</div>

Looks like a bug to me.

---

<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, 10:24pm UTC](https://discuss.elastic.co/t/strange-result-when-using-range-filter-with-out-of-range-values-possible-bug/59226/3 "2017-07-05T22:24:21Z")

</div>


