# Regexp for integer aggregation

**URL:** <https://discuss.elastic.co/t/regexp-for-integer-aggregation/75185>\
**Category:** Elasticsearch\
**Created:** [February 15, 2017, 11:52am UTC](https://discuss.elastic.co/t/regexp-for-integer-aggregation/75185 "2017-02-15T11:52:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbw](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@tbw](https://discuss.elastic.co/u/tbw)\
**Post date:** [February 15, 2017, 11:52am UTC](https://discuss.elastic.co/t/regexp-for-integer-aggregation/75185/1 "2017-02-15T11:52:00Z")

</div>

1. How to do this for integer?
2. This example for string from documentation ([Terms aggregation | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html)), and it is contain error:

> {  
> "aggs" : {  
> "tags" : {  
> "terms" : {  
> "field" : "tags",  
> "include" : "._sport._",  
> "exclude" : "water\_.\*"  
> }  
> }  
> }  
> }

Must be "tags.keyword" or illegal\_argument\_exception will thrown.

---

<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 15, 2017, 11:52am UTC](https://discuss.elastic.co/t/regexp-for-integer-aggregation/75185/2 "2017-03-15T11:52:01Z")

</div>

Closed on March 15, 2017, 11:52am UTC

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