# How can I search for a pattern that consists of a five character string of numbers?

**URL:** <https://discuss.elastic.co/t/how-can-i-search-for-a-pattern-that-consists-of-a-five-character-string-of-numbers/9994>\
**Category:** Elasticsearch\
**Created:** [December 7, 2012, 9:40pm UTC](https://discuss.elastic.co/t/how-can-i-search-for-a-pattern-that-consists-of-a-five-character-string-of-numbers/9994 "2012-12-07T21:40:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbrianjones](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbrianjones/32/1402_2.png) [@tbrianjones](https://discuss.elastic.co/u/tbrianjones)\
**Post date:** [December 7, 2012, 9:40pm UTC](https://discuss.elastic.co/t/how-can-i-search-for-a-pattern-that-consists-of-a-five-character-string-of-numbers/9994/1 "2012-12-07T21:40:14Z")

</div>

I am using an Elasticsearch index to process meta data about sets of  
documents, but want to use the same index for regular search in production  
( as it is a very large index ).

I want to search for State Name Abreviations, but to get accurate data, I  
need to look for a pattern.

I could search for a comma, followed by a space, followed by the  
abbreviation ( eg. ", CA" ), but then I have to set up whitespace and comma  
tokenizers on every document field in my index. This seems like it will  
grow my index considerably, which will decrease performance  
in production where the bulk of access to this index happens.

How would I search for a five character string of numbers? Could I do this  
without setting up custom tokenizing or analyzing? Then I could search for  
the pattern "CA #####".

--

---

<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 6, 2017, 3:00am UTC](https://discuss.elastic.co/t/how-can-i-search-for-a-pattern-that-consists-of-a-five-character-string-of-numbers/9994/2 "2017-07-06T03:00:47Z")

</div>

Closed on July 6, 2017, 3:00am UTC


