# How to query keyword nested field that can be an integer values in ElasticSearch?

**URL:** <https://discuss.elastic.co/t/how-to-query-keyword-nested-field-that-can-be-an-integer-values-in-elasticsearch/221381>\
**Category:** Elasticsearch\
**Created:** [February 28, 2020, 8:00am UTC](https://discuss.elastic.co/t/how-to-query-keyword-nested-field-that-can-be-an-integer-values-in-elasticsearch/221381 "2020-02-28T08:00:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![111230](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111230/32/47196_2.png) [@111230](https://discuss.elastic.co/u/111230)\
**Post date:** [February 28, 2020, 8:00am UTC](https://discuss.elastic.co/t/how-to-query-keyword-nested-field-that-can-be-an-integer-values-in-elasticsearch/221381/1 "2020-02-28T08:00:18Z")

</div>

This is example of field in ES document. How can i query 'prices.value' that can be only integers?

In this case, value is "150.99" and can fully be converted to integer. But sometimes in can be a text something like "value": "a lot" and i want to exclude document with this values.

```auto
"prices": [
     {
      "currency": "RUR",
      "id_offer": 605994811,
       "id_prcdoc": 42172,
        "id_prcknd": 20859,
         "info": {},
         "min_order": null,
         "sell_by": null,
         "value": "150.99"}]

```

```
Index of this field:

    "prices": {
        "type": "nested",
        "properties": {
          "currency": {
            "type": "keyword"
          },
          "id_offer": {
            "type": "integer"
          },
          "id_prcdoc": {
            "type": "integer"
          },
          "id_prcknd": {
            "type": "integer"
          },
          "min_order": {
            "type": "keyword"
          },
          "sell_by": {
            "type": "keyword"
          },
          "value": {
            "type": "keyword",
            "index": false
          }
        }
      }

```

And sometimes it 'value' field can be '0.00' and probably i want to exclude this values to..

---

<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:** [March 27, 2020, 8:00am UTC](https://discuss.elastic.co/t/how-to-query-keyword-nested-field-that-can-be-an-integer-values-in-elasticsearch/221381/2 "2020-03-27T08:00:22Z")

</div>

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