# Limit int size

**URL:** <https://discuss.elastic.co/t/limit-int-size/61560>\
**Category:** Elasticsearch\
**Created:** [September 27, 2016, 5:46am UTC](https://discuss.elastic.co/t/limit-int-size/61560 "2016-09-27T05:46:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![muhamadli302](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@muhamadli302](https://discuss.elastic.co/u/muhamadli302)\
**Post date:** [September 27, 2016, 5:46am UTC](https://discuss.elastic.co/t/limit-int-size/61560/1 "2016-09-27T05:46:28Z")

</div>

Hi,

I'm using ES 1.7, and I want to be able to limit my int fields.  
For example, I have a field that represents percentages. So I want the value to be 0-100. If the value is not in that range, then ES should have null/not insert anything.

Is there's a way to do this with ES, or should I find a way to "fix" the index once all the data is inserted? (BTW, I'm using elasticsearch-py to insert the data)

Thanks!

---

<div class="post-metadata">

**Author:** ![vandamo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vandamo/32/8203_2.png) [@vandamo](https://discuss.elastic.co/u/vandamo)\
**Post date:** [September 27, 2016, 6:21am UTC](https://discuss.elastic.co/t/limit-int-size/61560/2 "2016-09-27T06:21:24Z")

</div>

I haven't seen a way to do what you describe,  
but as you're using elasticsearch-py, wouldn't it be easier to test the fields and remove them from the event if they don't match your criteria prior to insertion?

---

<div class="post-metadata">

**Author:** ![muhamadli302](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@muhamadli302](https://discuss.elastic.co/u/muhamadli302)\
**Post date:** [September 27, 2016, 6:26am UTC](https://discuss.elastic.co/t/limit-int-size/61560/3 "2016-09-27T06:26:54Z")

</div>

Yeah after further reading I figured this is what I'll probably do. Thanks!

---

<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:17pm UTC](https://discuss.elastic.co/t/limit-int-size/61560/4 "2017-07-05T22:17:03Z")

</div>

Closed on July 5, 2017, 10:17pm UTC


