# How to do a range query to match all greater than X

**URL:** <https://discuss.elastic.co/t/how-to-do-a-range-query-to-match-all-greater-than-x/102434>\
**Category:** Elasticsearch\
**Created:** [October 2, 2017, 11:59am UTC](https://discuss.elastic.co/t/how-to-do-a-range-query-to-match-all-greater-than-x/102434 "2017-10-02T11:59:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)\
**Post date:** [October 2, 2017, 11:59am UTC](https://discuss.elastic.co/t/how-to-do-a-range-query-to-match-all-greater-than-x/102434/1 "2017-10-02T11:59:06Z")

</div>

How to do a range query to match all greater than X?

for an example all that the delay field has a value greater than 3 as in the following example:

```
{ "range": 
          { 
            "delay": 
              {
                "gte": 3,
                "lt": infinity
              } 
          }
        }
```

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [October 2, 2017, 12:11pm UTC](https://discuss.elastic.co/t/how-to-do-a-range-query-to-match-all-greater-than-x/102434/2 "2017-10-02T12:11:24Z")

</div>

You can just leave out the "lt" field and the query will be unbounded on the upper bound.

---

<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:** [October 30, 2017, 12:11pm UTC](https://discuss.elastic.co/t/how-to-do-a-range-query-to-match-all-greater-than-x/102434/3 "2017-10-30T12:11:42Z")

</div>

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