# Search UTF-8 text for both diacritics and non-diacritics variants

**URL:** <https://discuss.elastic.co/t/search-utf-8-text-for-both-diacritics-and-non-diacritics-variants/5005>\
**Category:** Elasticsearch\
**Created:** [July 31, 2011, 10:37am UTC](https://discuss.elastic.co/t/search-utf-8-text-for-both-diacritics-and-non-diacritics-variants/5005 "2011-07-31T10:37:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julian/32/3155_2.png) [@Julian](https://discuss.elastic.co/u/Julian)\
**Post date:** [July 31, 2011, 10:37am UTC](https://discuss.elastic.co/t/search-utf-8-text-for-both-diacritics-and-non-diacritics-variants/5005/1 "2011-07-31T10:37:47Z")

</div>

Hi,

I am using Elastic Search to index a lot of data in Romanian,  
containing specific characters in UTF-8 encoding: ș, ț, î, ă, â, Ă, Â,  
Ț, Ș, Î.  
The indexing works fine and so does the searching - I'm using PHP with  
the elastica client.

Now I'm trying to some searches and I want Elastic Search to match the  
text with both diacritics and without them.  
Let me give you an example: I'm searching for "Bucuresti" (which is  
Romanian for Bucharest) and currently Elastic Search is correctly  
returning the results. However I would like to also get the results  
for "București" (which is the correct form containing the diacritics)  
when I search for "Bucuresti".

For example, try to search for "Bucuresti" with Google - it will  
return results for both "Bucuresti" and "București".

How can I do this with Elastic Search?

Thanks,  
Julian.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [July 31, 2011, 3:01pm UTC](https://discuss.elastic.co/t/search-utf-8-text-for-both-diacritics-and-non-diacritics-variants/5005/2 "2011-07-31T15:01:07Z")

</div>

have you tried using ascii folding filter with custom analysis on the  
relevant fields?

On Sun, Jul 31, 2011 at 1:37 PM, Julian [iulian@iconmedia.ro](mailto:iulian@iconmedia.ro) wrote:

> Hi,
> 
> I am using Elastic Search to index a lot of data in Romanian,  
> containing specific characters in UTF-8 encoding: ș, ț, î, ă, â, Ă, Â,  
> Ț, Ș, Î.  
> The indexing works fine and so does the searching - I'm using PHP with  
> the elastica client.
> 
> Now I'm trying to some searches and I want Elastic Search to match the  
> text with both diacritics and without them.  
> Let me give you an example: I'm searching for "Bucuresti" (which is  
> Romanian for Bucharest) and currently Elastic Search is correctly  
> returning the results. However I would like to also get the results  
> for "București" (which is the correct form containing the diacritics)  
> when I search for "Bucuresti".
> 
> For example, try to search for "Bucuresti" with Google - it will  
> return results for both "Bucuresti" and "București".
> 
> How can I do this with Elastic Search?
> 
> Thanks,  
> Julian.

---

<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:58am UTC](https://discuss.elastic.co/t/search-utf-8-text-for-both-diacritics-and-non-diacritics-variants/5005/3 "2017-07-06T03:58:46Z")

</div>


