# Search ignoring whitespaces

**URL:** <https://discuss.elastic.co/t/search-ignoring-whitespaces/2640>\
**Category:** Elasticsearch\
**Created:** [June 14, 2015, 10:03am UTC](https://discuss.elastic.co/t/search-ignoring-whitespaces/2640 "2015-06-14T10:03:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SpinBoldak](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@SpinBoldak](https://discuss.elastic.co/u/SpinBoldak)\
**Post date:** [June 14, 2015, 10:03am UTC](https://discuss.elastic.co/t/search-ignoring-whitespaces/2640/1 "2015-06-14T10:03:05Z")

</div>

How can I perform a query ignoring the whitespaces of one attribute ?

The use-case scenario is fairly simple: we have phone numbers indexed as strings and with a wide variety of formats ("123456789", "123 456 789", "123-456789", "111222333 OR 123456789", ...). A search query performed with the "simplified number" (e.g., 123456789) should return all the matches that contain that sequence of characters, regardless of whitespaces (and ideally, other characters like "/"). For the given examples, it would return all those records.

It seems like a situation where one would use an analyzer to split the indexed attributes in terms, and perform a query with "joined terms", but I'm not really sure this is a default behaviour of any analyzer or how to apply/define it.

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 6, 2017, 12:07am UTC](https://discuss.elastic.co/t/search-ignoring-whitespaces/2640/2 "2017-07-06T00:07:40Z")

</div>


