# I want to get the same results if the words have empty space or no space

**URL:** <https://discuss.elastic.co/t/i-want-to-get-the-same-results-if-the-words-have-empty-space-or-no-space/294492>\
**Category:** Elasticsearch\
**Created:** [January 16, 2022, 8:03am UTC](https://discuss.elastic.co/t/i-want-to-get-the-same-results-if-the-words-have-empty-space-or-no-space/294492 "2022-01-16T08:03:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amir\_Faramarzi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amir_faramarzi/32/92919_2.png) [@Amir\_Faramarzi](https://discuss.elastic.co/u/Amir_Faramarzi)\
**Post date:** [January 16, 2022, 8:03am UTC](https://discuss.elastic.co/t/i-want-to-get-the-same-results-if-the-words-have-empty-space-or-no-space/294492/1 "2022-01-16T08:03:16Z")

</div>

Hi everyone

I want to get the same results if the words have empty space or no space.

For example, we have a product called "washing mach ine" and I want the washing machine to return if the user searches for the word "washing machine".

Conversely, if the user searches for the word "washingmachine", the washing machine will be returned

And consider that the searches in my system are based on Persian language

Examples in Persian are as follows

"ماشین لباسشویی -\> ماشین لباس شویی"

"چراغ اویز -\> چراغاویز"

---

<div class="post-metadata">

**Author:** ![Amir\_Faramarzi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amir_faramarzi/32/92919_2.png) [@Amir\_Faramarzi](https://discuss.elastic.co/u/Amir_Faramarzi)\
**Post date:** [January 16, 2022, 10:37am UTC](https://discuss.elastic.co/t/i-want-to-get-the-same-results-if-the-words-have-empty-space-or-no-space/294492/2 "2022-01-16T10:37:42Z")

</div>

@Mark_Harwood @DavidTurner

---

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [January 16, 2022, 10:47am UTC](https://discuss.elastic.co/t/i-want-to-get-the-same-results-if-the-words-have-empty-space-or-no-space/294492/3 "2022-01-16T10:47:53Z")

</div>

How about using Mapping Character Filter with `{"mappings":["\\u0020 =>"]}` and N-gram tokenizer?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [January 16, 2022, 12:46pm UTC](https://discuss.elastic.co/t/i-want-to-get-the-same-results-if-the-words-have-empty-space-or-no-space/294492/4 "2022-01-16T12:46:18Z")

</div>

It's impolite to `@mention` random people that aren't involved in your conversation. Please don't do this.

---

<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:** [February 13, 2022, 12:46pm UTC](https://discuss.elastic.co/t/i-want-to-get-the-same-results-if-the-words-have-empty-space-or-no-space/294492/5 "2022-02-13T12:46:37Z")

</div>

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