# Phone # search query

**URL:** <https://discuss.elastic.co/t/phone-search-query/45281>\
**Category:** Elasticsearch\
**Created:** [March 23, 2016, 8:00pm UTC](https://discuss.elastic.co/t/phone-search-query/45281 "2016-03-23T20:00:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ernitingoel](https://avatars.discourse-cdn.com/v4/letter/e/8e7dd6/32.png) [@ernitingoel](https://discuss.elastic.co/u/ernitingoel)\
**Post date:** [March 23, 2016, 8:00pm UTC](https://discuss.elastic.co/t/phone-search-query/45281/1 "2016-03-23T20:00:44Z")

</div>

I am having the phone # in the following format

(123) 456-789

I would like to build a search query which will result me this phone whenever user specify any of the following values

12  
123  
12345  
1234567  
123456789

Because of special characters '(', I am facing it difficult to get it.

May I know the best possible way to achieve this?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [March 23, 2016, 8:31pm UTC](https://discuss.elastic.co/t/phone-search-query/45281/2 "2016-03-23T20:31:47Z")

</div>

I'd do phone numbers with a prefix search or a completion suggester and I'd strip all the special characters on the application side. You could also look at the [pattern replace token filter](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-pattern-replace-charfilter.html).

---

<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, 11:05pm UTC](https://discuss.elastic.co/t/phone-search-query/45281/3 "2017-07-05T23:05:43Z")

</div>


