# Wildcard characters

**URL:** <https://discuss.elastic.co/t/wildcard-characters/6756>\
**Category:** Elasticsearch\
**Created:** [February 20, 2012, 9:23am UTC](https://discuss.elastic.co/t/wildcard-characters/6756 "2012-02-20T09:23:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tobias\_Wallenqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tobias_wallenqvist/32/2985_2.png) [@Tobias\_Wallenqvist](https://discuss.elastic.co/u/Tobias_Wallenqvist)\
**Post date:** [February 20, 2012, 9:23am UTC](https://discuss.elastic.co/t/wildcard-characters/6756/1 "2012-02-20T09:23:16Z")

</div>

Hello All!

I have a problem where i have words (strings) indexed that contains  
special characters (é,û ex). The problem comes when the users search  
for the exact word, but containing e and u, and they don't get any  
hits.

Is it possible to map è as e and û as u, Is there a solution in  
elastic or should i re-parse the data before adding it to the index.  
But then i will have the opposite problem where some users search for  
the word with è and don't get a hit due to it containing en regular e.

Hope someone have had the same problem..

/Tobias

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [February 20, 2012, 11:32am UTC](https://discuss.elastic.co/t/wildcard-characters/6756/2 "2012-02-20T11:32:33Z")

</div>

Hi Tobias

> I have a problem where i have words (strings) indexed that contains  
> special characters (Ã©,Ã» ex). The problem comes when the users search  
> for the exact word, but containing e and u, and they don't get any  
> hits.

You need to create a custom analyzer which uses the ascii folding token  
filter

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

clint

> Is it possible to map Ã¨ as e and Ã» as u, Is there a solution in  
> elastic or should i re-parse the data before adding it to the index.  
> But then i will have the opposite problem where some users search for  
> the word with Ã¨ and don't get a hit due to it containing en regular e.
> 
> Hope someone have had the same problem..
> 
> /Tobias

---

<div class="post-metadata">

**Author:** ![Tobias\_Wallenqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tobias_wallenqvist/32/2985_2.png) [@Tobias\_Wallenqvist](https://discuss.elastic.co/u/Tobias_Wallenqvist)\
**Post date:** [February 20, 2012, 11:47am UTC](https://discuss.elastic.co/t/wildcard-characters/6756/3 "2012-02-20T11:47:14Z")

</div>

Ah sweet, thanx!

On 20 Feb, 12:32, Clinton Gormley [cl...@traveljury.com](mailto:cl...@traveljury.com) wrote:

> Hi Tobias
> 
> > I have a problem where i have words (strings) indexed that contains  
> > special characters (é,û ex). The problem comes when the users search  
> > for the exact word, but containing e and u, and they don't get any  
> > hits.
> 
> You need to create a custom analyzer which uses the ascii folding token  
> filterhttp://www.elasticsearch.org/guide/reference/index-modules/analysis/a...
> 
> clint
> 
> > Is it possible to map è as e and û as u, Is there a solution in  
> > elastic or should i re-parse the data before adding it to the index.  
> > But then i will have the opposite problem where some users search for  
> > the word with è and don't get a hit due to it containing en regular e.
> 
> > Hope someone have had the same problem..
> 
> > /Tobias

---

<div class="post-metadata">

**Author:** ![Tobias\_Wallenqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tobias_wallenqvist/32/2985_2.png) [@Tobias\_Wallenqvist](https://discuss.elastic.co/u/Tobias_Wallenqvist)\
**Post date:** [February 22, 2012, 11:47am UTC](https://discuss.elastic.co/t/wildcard-characters/6756/4 "2012-02-22T11:47:42Z")

</div>

I when ahead and added an asciifolding analyzer to my config file and  
it worked great, i had to reindex all my index before it worked.

I have a question though, is it possible to see analyzers that are  
active via some command, like \_mapping or so?

Have a great day and thanx for the tip.

/Tobias

On 20 Feb, 12:32, Clinton Gormley [cl...@traveljury.com](mailto:cl...@traveljury.com) wrote:

> Hi Tobias
> 
> > I have a problem where i have words (strings) indexed that contains  
> > special characters (é,û ex). The problem comes when the users search  
> > for the exact word, but containing e and u, and they don't get any  
> > hits.
> 
> You need to create a custom analyzer which uses the ascii folding token  
> filterhttp://www.elasticsearch.org/guide/reference/index-modules/analysis/a...
> 
> clint
> 
> > Is it possible to map è as e and û as u, Is there a solution in  
> > elastic or should i re-parse the data before adding it to the index.  
> > But then i will have the opposite problem where some users search for  
> > the word with è and don't get a hit due to it containing en regular e.
> 
> > Hope someone have had the same problem..
> 
> > /Tobias

---

<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:** [February 26, 2012, 9:40am UTC](https://discuss.elastic.co/t/wildcard-characters/6756/5 "2012-02-26T09:40:38Z")

</div>

Getting the index settings will return the analyzers used, though in a key value format (not the json one). [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-get-settings.html).

On Wednesday, February 22, 2012 at 1:47 PM, Tobias Wallenqvist wrote:

> I when ahead and added an asciifolding analyzer to my config file and  
> it worked great, i had to reindex all my index before it worked.
> 
> I have a question though, is it possible to see analyzers that are  
> active via some command, like \_mapping or so?
> 
> Have a great day and thanx for the tip.
> 
> /Tobias
> 
> On 20 Feb, 12:32, Clinton Gormley \<[cl...@traveljury.com](mailto:cl...@traveljury.com) ([http://traveljury.com](http://traveljury.com))\> wrote:
> 
> > Hi Tobias
> > 
> > > I have a problem where i have words (strings) indexed that contains  
> > > special characters (é,û ex). The problem comes when the users search  
> > > for the exact word, but containing e and u, and they don't get any  
> > > hits.
> > 
> > You need to create a custom analyzer which uses the ascii folding token  
> > filterhttp://www.elasticsearch.org/guide/reference/index-modules/analysis/a...
> > 
> > clint
> > 
> > > Is it possible to map è as e and û as u, Is there a solution in  
> > > elastic or should i re-parse the data before adding it to the index.  
> > > But then i will have the opposite problem where some users search for  
> > > the word with è and don't get a hit due to it containing en regular e.
> > 
> > > Hope someone have had the same problem..
> > 
> > > /Tobias

---

<div class="post-metadata">

**Author:** ![Barsk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/barsk/32/13734_2.png) [@Barsk](https://discuss.elastic.co/u/Barsk)\
**Post date:** [February 28, 2012, 1:45pm UTC](https://discuss.elastic.co/t/wildcard-characters/6756/6 "2012-02-28T13:45:29Z")

</div>

Clinton Gormley skrev 2012-02-20 12:32:

> Hi Tobias
> 
> > I have a problem where i have words (strings) indexed that contains  
> > special characters (Ã©,Ã» ex). The problem comes when the users search  
> > for the exact word, but containing e and u, and they don't get any  
> > hits.  
> > You need to create a custom analyzer which uses the ascii folding token  
> > filter  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/analysis/asciifolding-tokenfilter.html)
> 
> clint
> 
> > Is it possible to map Ã¨ as e and Ã» as u, Is there a solution in  
> > elastic or should i re-parse the data before adding it to the index.  
> > But then i will have the opposite problem where some users search for  
> > the word with Ã¨ and don't get a hit due to it containing en regular e.
> > 
> > Hope someone have had the same problem..
> > 
> > /Tobias

There is another approach to the problem. The icu\_folding filter  
([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/analysis/icu-plugin.html))  
does the same thing, but more thorough. The asciiFoldingFilter is a  
light approach to the problem. icu\_folding is also faster since it uses  
a compiled lookup table for the conversion.

I just contributed a fix to the icu\_folding filter that enables it to  
skip national characters (like Ã¥Ã¤Ã¶) in case you would like to be able to  
search those as-is. icu\_folding by default will remove ALL diacritics  
including those for Ã¥Ã¤Ã¶ -\> aao. The characters to skip is configured  
with a unicodeSetFilter parameter to the icu\_folding filter meaning it  
can be tuned to your requirements.

See my other post for more info on that. Hopefully it may end up in the  
master branch if it is accepted.

P.S I actually have a version of the asciiFoldingFilter that adds  
filtering too if needed, but it can be regarded as obsolete now D.S

/Kristian

---

<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:38am UTC](https://discuss.elastic.co/t/wildcard-characters/6756/7 "2017-07-06T03:38:00Z")

</div>


