# Persian word split

**URL:** <https://discuss.elastic.co/t/persian-word-split/147396>\
**Category:** Elasticsearch\
**Created:** [September 5, 2018, 11:42am UTC](https://discuss.elastic.co/t/persian-word-split/147396 "2018-09-05T11:42:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehrdad\_Mazhari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehrdad_mazhari/32/35191_2.png) [@Mehrdad\_Mazhari](https://discuss.elastic.co/u/Mehrdad_Mazhari)\
**Post date:** [September 5, 2018, 11:42am UTC](https://discuss.elastic.co/t/persian-word-split/147396/1 "2018-09-05T11:42:56Z")

</div>

Hi,  
I have two words for example  
1." دارو خانه عباسی"  
2."داروخانه عباسی"  
when I search  
"query": {  
"match": {  
"title": "داروخانه"  
}  
}  
my result is just number 2 but i want to show tow words  
how do I search?  
thanks

---

<div class="post-metadata">

**Author:** ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)\
**Post date:** [September 7, 2018, 1:57pm UTC](https://discuss.elastic.co/t/persian-word-split/147396/2 "2018-09-07T13:57:22Z")

</div>

There are several approaches I can think of, all of which require you to set up a [custom analyzer](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis.html). Through a custom analyzer you could implement either:

- [Synonyms](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-synonym-graph-tokenfilter.html). Basically a way of telling Elasticsearch: _if I search for "داروخانه", I also want to find "دارو خانه"._
- [Decompounding](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-compound-word-tokenfilter.html). A way of breaking up compound words into their word parts.
- [NGrams](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-ngram-tokenfilter.html). A "brute force" method of searching for substrings of strings.

I'd say the synonym approach is the easiest to set up, but the downside of that approach is that you will have to provide and maintain a list of words that you want to match.

---

<div class="post-metadata">

**Author:** ![Mehrdad\_Mazhari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehrdad_mazhari/32/35191_2.png) [@Mehrdad\_Mazhari](https://discuss.elastic.co/u/Mehrdad_Mazhari)\
**Post date:** [September 8, 2018, 3:56am UTC](https://discuss.elastic.co/t/persian-word-split/147396/3 "2018-09-08T03:56:10Z")

</div>

Hi @abdon,  
thank you for response.I'v made a list of synonym words .I search the word too and synonym of the word too.

---

<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:** [October 6, 2018, 3:56am UTC](https://discuss.elastic.co/t/persian-word-split/147396/4 "2018-10-06T03:56:13Z")

</div>

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