# How to query only numeric values in a String field?

**URL:** <https://discuss.elastic.co/t/how-to-query-only-numeric-values-in-a-string-field/115066>\
**Category:** Elasticsearch\
**Created:** [January 11, 2018, 11:05am UTC](https://discuss.elastic.co/t/how-to-query-only-numeric-values-in-a-string-field/115066 "2018-01-11T11:05:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cab93](https://avatars.discourse-cdn.com/v4/letter/c/57b2e6/32.png) [@cab93](https://discuss.elastic.co/u/cab93)\
**Post date:** [January 11, 2018, 11:05am UTC](https://discuss.elastic.co/t/how-to-query-only-numeric-values-in-a-string-field/115066/1 "2018-01-11T11:05:34Z")

</div>

Hi there,  
I'm looking for a way to filter my query results.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/9/79506e209ef2a8303d70cc638fbb4170aaa45ffd.png)

I need to exclude all those results that are not only numbers.

Is there a way to this in "post production"? I'm using elastic as a database and cannot change definitions, only query it.

---

<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:** [January 11, 2018, 3:15pm UTC](https://discuss.elastic.co/t/how-to-query-only-numeric-values-in-a-string-field/115066/2 "2018-01-11T15:15:54Z")

</div>

Please don't post images of text as they are hardly readable and not searchable.

Instead paste the text and format it with `</>` icon. Check the preview window.

May be you can try a range query with something like `key` lte `"a"`?

---

<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:** [February 8, 2018, 3:16pm UTC](https://discuss.elastic.co/t/how-to-query-only-numeric-values-in-a-string-field/115066/3 "2018-02-08T15:16:06Z")

</div>

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