# Configure the right analyzer

**URL:** <https://discuss.elastic.co/t/configure-the-right-analyzer/6586>\
**Category:** Elasticsearch\
**Created:** [February 3, 2012, 5:06pm UTC](https://discuss.elastic.co/t/configure-the-right-analyzer/6586 "2012-02-03T17:06:15Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![louis\_gueye](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/louis_gueye/32/2772_2.png) [@louis\_gueye](https://discuss.elastic.co/u/louis_gueye)\
**Post date:** [February 3, 2012, 5:06pm UTC](https://discuss.elastic.co/t/configure-the-right-analyzer/6586/1 "2012-02-03T17:06:15Z")

</div>

Hi all,

I'm having a hard time configuring correctly ES to find accented and  
non-accented words the same way.

Here is a sequence anyone can execute :

* * *

# delete index

curl -XDELETE '[http://localhost:9200/my\_index](http://localhost:9200/my_index)'

# create index

curl -XPOST '[http://localhost:9200/my\_index](http://localhost:9200/my_index)'

# check create ok

curl -XGET '[http://localhost:9200/my\_index/\_settings](http://localhost:9200/my_index/_settings)'

# close index

curl -XPOST '[http://localhost:9200/my\_index/\_close](http://localhost:9200/my_index/_close)'

# update index settings

curl -XPUT '[http://localhost:9200/my\_index/\_settings](http://localhost:9200/my_index/_settings)' -d '{  
"index.analysis.analyzer.default.type":"snowball",  
"index.analysis.analyzer.default.tokenizer":"standard",  
"index.analysis.analyzer.default.filter.0":"standard",  
"index.analysis.analyzer.default.filter.1":"lowercase",  
"index.analysis.analyzer.default.filter.2":"asciifolding",  
"index.analysis.analyzer.default.filter.3":"french\_stemmer",  
"index.analysis.filter.french\_stemmer.type":"stemmer",  
"index.analysis.filter.french\_stemmer.name":"light\_french"  
}'

# open index

curl -XPOST '[http://localhost:9200/my\_index/\_open](http://localhost:9200/my_index/_open)'

# check update index settings

curl -XGET '[http://localhost:9200/my\_index/\_settings](http://localhost:9200/my_index/_settings)'  
#\* create type\*  
_curl -XPUT '[http://localhost:9200/my\_index/my\_type/\_mapping](http://localhost:9200/my_index/my_type/_mapping)' -d  
'{"my\_type":{"properties":{"title":{"type":"string"},"reference":{"type":"string",  
"index":"not\_analyzed"}}}}'_

# check create type

curl -XGET '[http://localhost:9200/my\_index/my\_type/\_mapping](http://localhost:9200/my_index/my_type/_mapping)'

# _add data_

curl -XPUT '[http://localhost:9200/my\_index/my\_type/1](http://localhost:9200/my_index/my_type/1)' -d  
'{"reference":"ADV-REF-00000001", "title":"Ingénieur Java"}'  
curl -XPUT '[http://localhost:9200/my\_index/my\_type/2](http://localhost:9200/my_index/my_type/2)' -d  
'{"reference":"ADV-REF-00000002", "title":"Conservateur documentaliste"}'  
curl -XPUT '[http://localhost:9200/my\_index/my\_type/3](http://localhost:9200/my_index/my_type/3)' -d  
'{"reference":"ADV-REF-00000003", "title":"Technicien qualité validation  
H/F"}'  
curl -XPUT '[http://localhost:9200/my\_index/my\_type/4](http://localhost:9200/my_index/my_type/4)' -d  
'{"reference":"ADV-REF-00000004", "title":"Valet de chambre"}'  
curl -XPUT '[http://localhost:9200/my\_index/my\_type/5](http://localhost:9200/my_index/my_type/5)' -d  
'{"reference":"ADV-REF-00000005", "title":"Ingénieur PHP"}'

# check add data

curl -XGET '[http://localhost:9200/my\_index/my\_type/1](http://localhost:9200/my_index/my_type/1)'

# _search data_

## curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search](http://localhost:9200/my_index/my_type/_search)' -d '{"query":{"query\_string":{"analyze\_wildcard":"true", "query":"title:_ingenieur_"}}}' curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search](http://localhost:9200/my_index/my_type/_search)' -d '{"query":{"query\_string":{"analyze\_wildcard":"true", "query":"title:_ingénieur_"}}}' curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search](http://localhost:9200/my_index/my_type/_search)' -d '{"query":{"query\_string":{"analyze\_wildcard":"true", "query":"title:_inge_"}}}' curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search](http://localhost:9200/my_index/my_type/_search)' -d '{"query":{"query\_string":{"analyze\_wildcard":"true", "query":"title:_ingé_"}}}' curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search](http://localhost:9200/my_index/my_type/_search)' -d '{"query":{"query\_string":{"analyze\_wildcard":"true", "query":"title:_Ingenieur_"}}}' curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search](http://localhost:9200/my_index/my_type/_search)' -d '{"query":{"query\_string":{"analyze\_wildcard":"true", "query":"title:_Ingénieur_"}}}' curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search](http://localhost:9200/my_index/my_type/_search)' -d '{"query":{"query\_string":{"analyze\_wildcard":"true", "query":"title:_Inge_"}}}' curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search](http://localhost:9200/my_index/my_type/_search)' -d '{"query":{"query\_string":{"analyze\_wildcard":"true", "query":"title:_Ingé_"}}}'

I configured snowball, asciifolding, french\_stemmer on my index.

The queries should return 2 results corresponding to \_id=1 and \_id=5  
The first and the 5th return 0 result.

Any hint on what I am doing wrong ?

Thanks for your help,

--  
Cordialement/Regards,

Louis GUEYE  
linkedin [http://fr.linkedin.com/in/louisgueye](http://fr.linkedin.com/in/louisgueye) |  
blog[http://deepintojee.wordpress.com/](http://deepintojee.wordpress.com/)|  
twitter [http://twitter.com/#!/lgueye](http://twitter.com/#%21/lgueye)

---

<div class="post-metadata">

**Author:** ![Frederic](https://avatars.discourse-cdn.com/v4/letter/f/4491bb/32.png) [@Frederic](https://discuss.elastic.co/u/Frederic)\
**Post date:** [February 4, 2012, 8:35pm UTC](https://discuss.elastic.co/t/configure-the-right-analyzer/6586/2 "2012-02-04T20:35:19Z")

</div>

Hi Louis,

If I'm not wrong, I think you need to change this statement:

> _curl -XPUT '[http://localhost:9200/my\_index/my\_type/\_mapping'-d](http://localhost:9200/my_index/my_type/_mapping'-d)  
> '{"my\_type":{"properties":{"title":{"type":"string"},"reference":{"type":"string",  
> "index":"not\_analyzed"}}}}'_

by "index":"analyzed" (which is the default actually). That means  
your data will be analyzed by the analyzers you have configured.

You can also create your 'custom' analyzer instead of defining default  
analyzers and filters for the whole index, so that you can reuse it  
for specific fields/types. Here it is an example of a custom analyzer  
I created recently: [ES - Adding new custom analyzer · GitHub](https://gist.github.com/1671402)

You can test your analyzers using the Analyze API, which analyze a  
given text and returns the tokens your analyzer generates:

> **[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.

Additionally I think you could simplify you tests defining your index  
settings, type and mapping all together in the index creation request.

Finally, I've recommend you the following links:

#Index creation and settings

> **[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.

#Mapping definitions for Core Types (which mentions the analyzed/noy-  
analyzed difference)

> **[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.

#Custom analyzers

> **[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.

Hope it helps!  
Cheers,

Federic

On Feb 3, 2:06 pm, louis gueye [louis.gu...@gmail.com](mailto:louis.gu...@gmail.com) wrote:

> Hi all,
> 
> I'm having a hard time configuring correctly ES to find accented and  
> non-accented words the same way.
> 
> Here is a sequence anyone can execute :
> 
> * * *
> 
> # delete index
> 
> curl -XDELETE '[http://localhost:9200/my\_index](http://localhost:9200/my_index)'
> 
> # create index
> 
> curl -XPOST '[http://localhost:9200/my\_index](http://localhost:9200/my_index)'
> 
> # check create ok
> 
> curl -XGET '[http://localhost:9200/my\_index/\_settings](http://localhost:9200/my_index/_settings)'
> 
> # close index
> 
> curl -XPOST '[http://localhost:9200/my\_index/\_close](http://localhost:9200/my_index/_close)'
> 
> # update index settings
> 
> curl -XPUT '[http://localhost:9200/my\_index/\_settings'-d](http://localhost:9200/my_index/_settings'-d) '{  
> "index.analysis.analyzer.default.type":"snowball",  
> "index.analysis.analyzer.default.tokenizer":"standard",  
> "index.analysis.analyzer.default.filter.0":"standard",  
> "index.analysis.analyzer.default.filter.1":"lowercase",  
> "index.analysis.analyzer.default.filter.2":"asciifolding",  
> "index.analysis.analyzer.default.filter.3":"french\_stemmer",  
> "index.analysis.filter.french\_stemmer.type":"stemmer",  
> "index.analysis.filter.french\_stemmer.name":"light\_french"}'
> 
> # open index
> 
> curl -XPOST '[http://localhost:9200/my\_index/\_open](http://localhost:9200/my_index/_open)'
> 
> # check update index settings
> 
> curl -XGET '[http://localhost:9200/my\_index/\_settings](http://localhost:9200/my_index/_settings)'  
> #\* create type\*  
> _curl -XPUT '[http://localhost:9200/my\_index/my\_type/\_mapping'-d](http://localhost:9200/my_index/my_type/_mapping'-d)  
> '{"my\_type":{"properties":{"title":{"type":"string"},"reference":{"type":"string",  
> "index":"not\_analyzed"}}}}'_
> 
> # check create type
> 
> curl -XGET '[http://localhost:9200/my\_index/my\_type/\_mapping](http://localhost:9200/my_index/my_type/_mapping)'
> 
> # _add data_
> 
> curl -XPUT '[http://localhost:9200/my\_index/my\_type/1'-d](http://localhost:9200/my_index/my_type/1'-d)  
> '{"reference":"ADV-REF-00000001", "title":"Ingénieur Java"}'  
> curl -XPUT '[http://localhost:9200/my\_index/my\_type/2'-d](http://localhost:9200/my_index/my_type/2'-d)  
> '{"reference":"ADV-REF-00000002", "title":"Conservateur documentaliste"}'  
> curl -XPUT '[http://localhost:9200/my\_index/my\_type/3'-d](http://localhost:9200/my_index/my_type/3'-d)  
> '{"reference":"ADV-REF-00000003", "title":"Technicien qualité validation  
> H/F"}'  
> curl -XPUT '[http://localhost:9200/my\_index/my\_type/4'-d](http://localhost:9200/my_index/my_type/4'-d)  
> '{"reference":"ADV-REF-00000004", "title":"Valet de chambre"}'  
> curl -XPUT '[http://localhost:9200/my\_index/my\_type/5'-d](http://localhost:9200/my_index/my_type/5'-d)  
> '{"reference":"ADV-REF-00000005", "title":"Ingénieur PHP"}'
> 
> # check add data
> 
> curl -XGET '[http://localhost:9200/my\_index/my\_type/1](http://localhost:9200/my_index/my_type/1)'
> 
> # _search data_
> 
> ## curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d) '{"query":{"query\_string":{"analyze\_wildcard":"true", "query":"title:_ingenieur_"}}}' curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d) '{"query":{"query\_string":{"analyze\_wildcard":"true", "query":"title:_ingénieur_"}}}' curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d) '{"query":{"query\_string":{"analyze\_wildcard":"true", "query":"title:_inge_"}}}' curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d) '{"query":{"query\_string":{"analyze\_wildcard":"true", "query":"title:_ingé_"}}}' curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d) '{"query":{"query\_string":{"analyze\_wildcard":"true", "query":"title:_Ingenieur_"}}}' curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d) '{"query":{"query\_string":{"analyze\_wildcard":"true", "query":"title:_Ingénieur_"}}}' curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d) '{"query":{"query\_string":{"analyze\_wildcard":"true", "query":"title:_Inge_"}}}' curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d) '{"query":{"query\_string":{"analyze\_wildcard":"true", "query":"title:_Ingé_"}}}'
> 
> I configured snowball, asciifolding, french\_stemmer on my index.
> 
> The queries should return 2 results corresponding to \_id=1 and \_id=5  
> The first and the 5th return 0 result.
> 
> Any hint on what I am doing wrong ?
> 
> Thanks for your help,
> 
> --  
> Cordialement/Regards,
> 
> Louis GUEYE  
> linkedin [http://fr.linkedin.com/in/louisgueye](http://fr.linkedin.com/in/louisgueye) |  
> blog[http://deepintojee.wordpress.com/](http://deepintojee.wordpress.com/)|  
> twitter [http://twitter.com/#!/lgueye](http://twitter.com/#%21/lgueye)

---

<div class="post-metadata">

**Author:** ![louis\_gueye](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/louis_gueye/32/2772_2.png) [@louis\_gueye](https://discuss.elastic.co/u/louis_gueye)\
**Post date:** [February 6, 2012, 9:10am UTC](https://discuss.elastic.co/t/configure-the-right-analyzer/6586/3 "2012-02-06T09:10:15Z")

</div>

Hi Frederic,

1 - The "not\_analyzed" for the reference property is on purpose. Reference  
is a term thus doesn't need analyzing  
2 - I know I can specify all settings during index creation but in  
production you cannot afford to drop your index and re-create it. So I  
wanted to do it at runtime. By the way, I'm also interested in any working  
solution to that propblem.  
3 - I'll give a try at the analyze API.

Anyway thank you for the reply

2012/2/4 Frederic [focampo.br@gmail.com](mailto:focampo.br@gmail.com)

> Hi Louis,
> 
> If I'm not wrong, I think you need to change this statement:
> 
> > \*curl -XPUT '[http://localhost:9200/my\_index/my\_type/\_mapping'-d](http://localhost:9200/my_index/my_type/_mapping'-d)
> 
> '{"my\_type":{"properties":{"title":{"type":"string"},"reference":{"type":"string",
> 
> > "index":"not\_analyzed"}}}}'\*
> 
> by "index":"analyzed" (which is the default actually). That means  
> your data will be analyzed by the analyzers you have configured.
> 
> You can also create your 'custom' analyzer instead of defining default  
> analyzers and filters for the whole index, so that you can reuse it  
> for specific fields/types. Here it is an example of a custom analyzer  
> I created recently: [ES - Adding new custom analyzer · GitHub](https://gist.github.com/1671402)
> 
> You can test your analyzers using the Analyze API, which analyze a  
> given text and returns the tokens your analyzer generates:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze.html)
> 
> Additionally I think you could simplify you tests defining your index  
> settings, type and mapping all together in the index creation request.
> 
> Finally, I've recommend you the following links:
> 
> #Index creation and settings
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index.html)
> 
> #Mapping definitions for Core Types (which mentions the analyzed/noy-  
> analyzed difference)  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/core-types.html)
> 
> #Custom analyzers
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/analysis/custom-analyzer.html)
> 
> Hope it helps!  
> Cheers,
> 
> Federic
> 
> On Feb 3, 2:06 pm, louis gueye [louis.gu...@gmail.com](mailto:louis.gu...@gmail.com) wrote:
> 
> > Hi all,
> > 
> > I'm having a hard time configuring correctly ES to find accented and  
> > non-accented words the same way.
> > 
> > Here is a sequence anyone can execute :
> 
> * * *
> 
> > # delete index
> > 
> > curl -XDELETE '[http://localhost:9200/my\_index](http://localhost:9200/my_index)'
> > 
> > # create index
> > 
> > curl -XPOST '[http://localhost:9200/my\_index](http://localhost:9200/my_index)'
> > 
> > # check create ok
> > 
> > curl -XGET '[http://localhost:9200/my\_index/\_settings](http://localhost:9200/my_index/_settings)'
> > 
> > # close index
> > 
> > curl -XPOST '[http://localhost:9200/my\_index/\_close](http://localhost:9200/my_index/_close)'
> > 
> > # update index settings
> > 
> > curl -XPUT '[http://localhost:9200/my\_index/\_settings'-d](http://localhost:9200/my_index/_settings'-d) '{  
> > "index.analysis.analyzer.default.type":"snowball",  
> > "index.analysis.analyzer.default.tokenizer":"standard",  
> > "index.analysis.analyzer.default.filter.0":"standard",  
> > "index.analysis.analyzer.default.filter.1":"lowercase",  
> > "index.analysis.analyzer.default.filter.2":"asciifolding",  
> > "index.analysis.analyzer.default.filter.3":"french\_stemmer",  
> > "index.analysis.filter.french\_stemmer.type":"stemmer",  
> > "index.analysis.filter.french\_stemmer.name":"light\_french"}'
> > 
> > # open index
> > 
> > curl -XPOST '[http://localhost:9200/my\_index/\_open](http://localhost:9200/my_index/_open)'
> > 
> > # check update index settings
> > 
> > curl -XGET '[http://localhost:9200/my\_index/\_settings](http://localhost:9200/my_index/_settings)'  
> > #\* create type\*  
> > \*curl -XPUT '[http://localhost:9200/my\_index/my\_type/\_mapping'-d](http://localhost:9200/my_index/my_type/_mapping'-d)
> 
> '{"my\_type":{"properties":{"title":{"type":"string"},"reference":{"type":"string",
> 
> > "index":"not\_analyzed"}}}}'\*
> > 
> > # check create type
> > 
> > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_mapping](http://localhost:9200/my_index/my_type/_mapping)'
> > 
> > # _add data_
> > 
> > curl -XPUT '[http://localhost:9200/my\_index/my\_type/1'-d](http://localhost:9200/my_index/my_type/1'-d)  
> > '{"reference":"ADV-REF-00000001", "title":"Ingénieur Java"}'  
> > curl -XPUT '[http://localhost:9200/my\_index/my\_type/2'-d](http://localhost:9200/my_index/my_type/2'-d)  
> > '{"reference":"ADV-REF-00000002", "title":"Conservateur documentaliste"}'  
> > curl -XPUT '[http://localhost:9200/my\_index/my\_type/3'-d](http://localhost:9200/my_index/my_type/3'-d)  
> > '{"reference":"ADV-REF-00000003", "title":"Technicien qualité validation  
> > H/F"}'  
> > curl -XPUT '[http://localhost:9200/my\_index/my\_type/4'-d](http://localhost:9200/my_index/my_type/4'-d)  
> > '{"reference":"ADV-REF-00000004", "title":"Valet de chambre"}'  
> > curl -XPUT '[http://localhost:9200/my\_index/my\_type/5'-d](http://localhost:9200/my_index/my_type/5'-d)  
> > '{"reference":"ADV-REF-00000005", "title":"Ingénieur PHP"}'
> > 
> > # check add data
> > 
> > curl -XGET '[http://localhost:9200/my\_index/my\_type/1](http://localhost:9200/my_index/my_type/1)'
> > 
> > # _search data_
> > 
> > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > "query":"title:_ingenieur_"}}}'  
> > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > "query":"title:_ingénieur_"}}}'  
> > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > "query":"title:_inge_"}}}'  
> > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > "query":"title:_ingé_"}}}'  
> > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > "query":"title:_Ingenieur_"}}}'  
> > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > "query":"title:_Ingénieur_"}}}'  
> > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > "query":"title:_Inge_"}}}'  
> > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > "query":"title:_Ingé_"}}}'
> 
> * * *
> 
> > I configured snowball, asciifolding, french\_stemmer on my index.
> > 
> > The queries should return 2 results corresponding to \_id=1 and \_id=5  
> > The first and the 5th return 0 result.
> > 
> > Any hint on what I am doing wrong ?
> > 
> > Thanks for your help,
> > 
> > --  
> > Cordialement/Regards,
> > 
> > Louis GUEYE  
> > linkedin [http://fr.linkedin.com/in/louisgueye](http://fr.linkedin.com/in/louisgueye) |  
> > blog[http://deepintojee.wordpress.com/](http://deepintojee.wordpress.com/)|  
> > twitter [http://twitter.com/#!/lgueye](http://twitter.com/#%21/lgueye)

--  
Cordialement/Regards,

Louis GUEYE  
linkedin [http://fr.linkedin.com/in/louisgueye](http://fr.linkedin.com/in/louisgueye) |  
blog[http://deepintojee.wordpress.com/](http://deepintojee.wordpress.com/)|  
twitter [http://twitter.com/#!/lgueye](http://twitter.com/#%21/lgueye)

---

<div class="post-metadata">

**Author:** ![Frederic](https://avatars.discourse-cdn.com/v4/letter/f/4491bb/32.png) [@Frederic](https://discuss.elastic.co/u/Frederic)\
**Post date:** [February 6, 2012, 6:09pm UTC](https://discuss.elastic.co/t/configure-the-right-analyzer/6586/4 "2012-02-06T18:09:37Z")

</div>

My fault, it seems I read the "not\_analyzed" statement associated with  
the title field, instead of the "reference" one.

Of course you're right that is not an option to recreate a productive  
index. Actually, adding a custom analyzer to an already productive  
index is what I had to do last week, opening and closing the index as  
you know, and I don't think there is another option to do so yet.

In my case I configured the analyzer with asciifolding filtering (as  
you can see in the Gist) and it worked perfectly for finding words  
with accents and special characters (spanish and portuges).

I'll reproduce your steps and let you know what I get. Anyway someone  
more experienced with ES could aid you more effectively than I :¬)

PS: Not sure if the queries are just for testing purposes but take  
into account that using wildcards as prefixes could generate very slow  
queries ([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/)  
wildcard-query.html)

On 6 feb, 06:10, louis gueye [louis.gu...@gmail.com](mailto:louis.gu...@gmail.com) wrote:

> Hi Frederic,
> 
> 1 - The "not\_analyzed" for the reference property is on purpose. Reference  
> is a term thus doesn't need analyzing  
> 2 - I know I can specify all settings during index creation but in  
> production you cannot afford to drop your index and re-create it. So I  
> wanted to do it at runtime. By the way, I'm also interested in any working  
> solution to that propblem.  
> 3 - I'll give a try at the analyze API.
> 
> Anyway thank you for the reply
> 
> 2012/2/4 Frederic [focampo...@gmail.com](mailto:focampo...@gmail.com)
> 
> > Hi Louis,
> 
> > If I'm not wrong, I think you need to change this statement:
> 
> > > \*curl -XPUT '[http://localhost:9200/my\_index/my\_type/\_mapping'-d](http://localhost:9200/my_index/my_type/_mapping'-d)
> 
> > '{"my\_type":{"properties":{"title":{"type":"string"},"reference":{"type":"string",
> > 
> > > "index":"not\_analyzed"}}}}'\*
> 
> > by "index":"analyzed" (which is the default actually). That means  
> > your data will be analyzed by the analyzers you have configured.
> 
> > You can also create your 'custom' analyzer instead of defining default  
> > analyzers and filters for the whole index, so that you can reuse it  
> > for specific fields/types. Here it is an example of a custom analyzer  
> > I created recently:[ES - Adding new custom analyzer · GitHub](https://gist.github.com/1671402)
> 
> > You can test your analyzers using the Analyze API, which analyze a  
> > given text and returns the tokens your analyzer generates:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-analyz)...
> 
> > Additionally I think you could simplify you tests defining your index  
> > settings, type and mapping all together in the index creation request.
> 
> > Finally, I've recommend you the following links:
> 
> > #Index creation and settings
> 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-create)...
> 
> > #Mapping definitions for Core Types (which mentions the analyzed/noy-  
> > analyzed difference)  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/core-types.html)
> 
> > #Custom analyzers
> 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/analysis/c)...
> 
> > Hope it helps!  
> > Cheers,
> 
> > Federic
> 
> > On Feb 3, 2:06 pm, louis gueye [louis.gu...@gmail.com](mailto:louis.gu...@gmail.com) wrote:
> > 
> > > Hi all,
> 
> > > I'm having a hard time configuring correctly ES to find accented and  
> > > non-accented words the same way.
> 
> > > Here is a sequence anyone can execute :
> 
> > * * *
> > 
> > > # delete index
> > > 
> > > curl -XDELETE '[http://localhost:9200/my\_index](http://localhost:9200/my_index)'
> > > 
> > > # create index
> > > 
> > > curl -XPOST '[http://localhost:9200/my\_index](http://localhost:9200/my_index)'
> > > 
> > > # check create ok
> > > 
> > > curl -XGET '[http://localhost:9200/my\_index/\_settings](http://localhost:9200/my_index/_settings)'
> > > 
> > > # close index
> > > 
> > > curl -XPOST '[http://localhost:9200/my\_index/\_close](http://localhost:9200/my_index/_close)'
> > > 
> > > # update index settings
> > > 
> > > curl -XPUT '[http://localhost:9200/my\_index/\_settings'-d'](http://localhost:9200/my_index/_settings'-d'){  
> > > "index.analysis.analyzer.default.type":"snowball",  
> > > "index.analysis.analyzer.default.tokenizer":"standard",  
> > > "index.analysis.analyzer.default.filter.0":"standard",  
> > > "index.analysis.analyzer.default.filter.1":"lowercase",  
> > > "index.analysis.analyzer.default.filter.2":"asciifolding",  
> > > "index.analysis.analyzer.default.filter.3":"french\_stemmer",  
> > > "index.analysis.filter.french\_stemmer.type":"stemmer",  
> > > "index.analysis.filter.french\_stemmer.name":"light\_french"}'
> 
> > > # open index
> > > 
> > > curl -XPOST '[http://localhost:9200/my\_index/\_open](http://localhost:9200/my_index/_open)'
> > > 
> > > # check update index settings
> > > 
> > > curl -XGET '[http://localhost:9200/my\_index/\_settings](http://localhost:9200/my_index/_settings)'  
> > > #\* create type\*  
> > > \*curl -XPUT '[http://localhost:9200/my\_index/my\_type/\_mapping'-d](http://localhost:9200/my_index/my_type/_mapping'-d)
> 
> > '{"my\_type":{"properties":{"title":{"type":"string"},"reference":{"type":"string",
> > 
> > > "index":"not\_analyzed"}}}}'\*
> > > 
> > > # check create type
> > > 
> > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_mapping](http://localhost:9200/my_index/my_type/_mapping)'
> > > 
> > > # _add data_
> > > 
> > > curl -XPUT '[http://localhost:9200/my\_index/my\_type/1'-d](http://localhost:9200/my_index/my_type/1'-d)  
> > > '{"reference":"ADV-REF-00000001", "title":"Ingénieur Java"}'  
> > > curl -XPUT '[http://localhost:9200/my\_index/my\_type/2'-d](http://localhost:9200/my_index/my_type/2'-d)  
> > > '{"reference":"ADV-REF-00000002", "title":"Conservateur documentaliste"}'  
> > > curl -XPUT '[http://localhost:9200/my\_index/my\_type/3'-d](http://localhost:9200/my_index/my_type/3'-d)  
> > > '{"reference":"ADV-REF-00000003", "title":"Technicien qualité validation  
> > > H/F"}'  
> > > curl -XPUT '[http://localhost:9200/my\_index/my\_type/4'-d](http://localhost:9200/my_index/my_type/4'-d)  
> > > '{"reference":"ADV-REF-00000004", "title":"Valet de chambre"}'  
> > > curl -XPUT '[http://localhost:9200/my\_index/my\_type/5'-d](http://localhost:9200/my_index/my_type/5'-d)  
> > > '{"reference":"ADV-REF-00000005", "title":"Ingénieur PHP"}'
> > > 
> > > # check add data
> > > 
> > > curl -XGET '[http://localhost:9200/my\_index/my\_type/1](http://localhost:9200/my_index/my_type/1)'
> > > 
> > > # _search data_
> > > 
> > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > > "query":"title:_ingenieur_"}}}'  
> > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > > "query":"title:_ingénieur_"}}}'  
> > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > > "query":"title:_inge_"}}}'  
> > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > > "query":"title:_ingé_"}}}'  
> > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > > "query":"title:_Ingenieur_"}}}'  
> > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > > "query":"title:_Ingénieur_"}}}'  
> > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > > "query":"title:_Inge_"}}}'  
> > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > > "query":"title:_Ingé_"}}}'
> 
> > * * *
> 
> > > I configured snowball, asciifolding, french\_stemmer on my index.
> 
> > > The queries should return 2 results corresponding to \_id=1 and \_id=5  
> > > The first and the 5th return 0 result.
> 
> > > Any hint on what I am doing wrong ?
> 
> > > Thanks for your help,
> 
> > > --  
> > > Cordialement/Regards,
> 
> > > Louis GUEYE  
> > > linkedin [http://fr.linkedin.com/in/louisgueye](http://fr.linkedin.com/in/louisgueye) |  
> > > blog[http://deepintojee.wordpress.com/](http://deepintojee.wordpress.com/)|  
> > > twitter [http://twitter.com/#!/lgueye](http://twitter.com/#%21/lgueye)
> 
> --  
> Cordialement/Regards,
> 
> Louis GUEYE  
> linkedin [http://fr.linkedin.com/in/louisgueye](http://fr.linkedin.com/in/louisgueye) |  
> blog[http://deepintojee.wordpress.com/](http://deepintojee.wordpress.com/)|  
> twitter [http://twitter.com/#!/lgueye](http://twitter.com/#%21/lgueye)

---

<div class="post-metadata">

**Author:** ![louis\_gueye](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/louis_gueye/32/2772_2.png) [@louis\_gueye](https://discuss.elastic.co/u/louis_gueye)\
**Post date:** [February 6, 2012, 11:16pm UTC](https://discuss.elastic.co/t/configure-the-right-analyzer/6586/5 "2012-02-06T23:16:13Z")

</div>

Thank you frederic.

I've already been warned about wildcards possible slowness but I could not  
manage to make my use cases (the ones I provided) pass.  
I really want a wildcardless solution but I didn't find yet.

Anyway thank you for your time.

Louis

2012/2/6 Frederic [focampo.br@gmail.com](mailto:focampo.br@gmail.com)

> My fault, it seems I read the "not\_analyzed" statement associated with  
> the title field, instead of the "reference" one.
> 
> Of course you're right that is not an option to recreate a productive  
> index. Actually, adding a custom analyzer to an already productive  
> index is what I had to do last week, opening and closing the index as  
> you know, and I don't think there is another option to do so yet.
> 
> In my case I configured the analyzer with asciifolding filtering (as  
> you can see in the Gist) and it worked perfectly for finding words  
> with accents and special characters (spanish and portuges).
> 
> I'll reproduce your steps and let you know what I get. Anyway someone  
> more experienced with ES could aid you more effectively than I :¬)
> 
> PS: Not sure if the queries are just for testing purposes but take  
> into account that using wildcards as prefixes could generate very slow  
> queries ([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/)  
> wildcard-query.html)
> 
> On 6 feb, 06:10, louis gueye [louis.gu...@gmail.com](mailto:louis.gu...@gmail.com) wrote:
> 
> > Hi Frederic,
> > 
> > 1 - The "not\_analyzed" for the reference property is on purpose.  
> > Reference  
> > is a term thus doesn't need analyzing  
> > 2 - I know I can specify all settings during index creation but in  
> > production you cannot afford to drop your index and re-create it. So I  
> > wanted to do it at runtime. By the way, I'm also interested in any  
> > working  
> > solution to that propblem.  
> > 3 - I'll give a try at the analyze API.
> > 
> > Anyway thank you for the reply
> > 
> > 2012/2/4 Frederic [focampo...@gmail.com](mailto:focampo...@gmail.com)
> > 
> > > Hi Louis,
> > 
> > > If I'm not wrong, I think you need to change this statement:
> > 
> > > > \*curl -XPUT '[http://localhost:9200/my\_index/my\_type/\_mapping'-d](http://localhost:9200/my_index/my_type/_mapping'-d)
> > 
> > >
> 
> '{"my\_type":{"properties":{"title":{"type":"string"},"reference":{"type":"string",
> 
> > > > "index":"not\_analyzed"}}}}'\*
> > 
> > > by "index":"analyzed" (which is the default actually). That means  
> > > your data will be analyzed by the analyzers you have configured.
> > 
> > > You can also create your 'custom' analyzer instead of defining default  
> > > analyzers and filters for the whole index, so that you can reuse it  
> > > for specific fields/types. Here it is an example of a custom analyzer  
> > > I created recently:[ES - Adding new custom analyzer · GitHub](https://gist.github.com/1671402)
> > 
> > > You can test your analyzers using the Analyze API, which analyze a  
> > > given text and returns the tokens your analyzer generates:  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-analyz).  
> > > ..
> > 
> > > Additionally I think you could simplify you tests defining your index  
> > > settings, type and mapping all together in the index creation request.
> > 
> > > Finally, I've recommend you the following links:
> > 
> > > #Index creation and settings
> > 
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-create).  
> > > ..
> > 
> > > #Mapping definitions for Core Types (which mentions the analyzed/noy-  
> > > analyzed difference)  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/core-types.html)
> > 
> > > #Custom analyzers
> > 
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/analysis/c).  
> > > ..
> > 
> > > Hope it helps!  
> > > Cheers,
> > 
> > > Federic
> > 
> > > On Feb 3, 2:06 pm, louis gueye [louis.gu...@gmail.com](mailto:louis.gu...@gmail.com) wrote:
> > > 
> > > > Hi all,
> > 
> > > > I'm having a hard time configuring correctly ES to find accented and  
> > > > non-accented words the same way.
> > 
> > > > Here is a sequence anyone can execute :
> > 
> > >
> 
> * * *
> 
> > > > # delete index
> > > > 
> > > > curl -XDELETE '[http://localhost:9200/my\_index](http://localhost:9200/my_index)'
> > > > 
> > > > # create index
> > > > 
> > > > curl -XPOST '[http://localhost:9200/my\_index](http://localhost:9200/my_index)'
> > > > 
> > > > # check create ok
> > > > 
> > > > curl -XGET '[http://localhost:9200/my\_index/\_settings](http://localhost:9200/my_index/_settings)'
> > > > 
> > > > # close index
> > > > 
> > > > curl -XPOST '[http://localhost:9200/my\_index/\_close](http://localhost:9200/my_index/_close)'
> > > > 
> > > > # update index settings
> > > > 
> > > > curl -XPUT '[http://localhost:9200/my\_index/\_settings'-d'](http://localhost:9200/my_index/_settings'-d'){  
> > > > "index.analysis.analyzer.default.type":"snowball",  
> > > > "index.analysis.analyzer.default.tokenizer":"standard",  
> > > > "index.analysis.analyzer.default.filter.0":"standard",  
> > > > "index.analysis.analyzer.default.filter.1":"lowercase",  
> > > > "index.analysis.analyzer.default.filter.2":"asciifolding",  
> > > > "index.analysis.analyzer.default.filter.3":"french\_stemmer",  
> > > > "index.analysis.filter.french\_stemmer.type":"stemmer",  
> > > > "index.analysis.filter.french\_stemmer.name":"light\_french"}'
> > 
> > > > # open index
> > > > 
> > > > curl -XPOST '[http://localhost:9200/my\_index/\_open](http://localhost:9200/my_index/_open)'
> > > > 
> > > > # check update index settings
> > > > 
> > > > curl -XGET '[http://localhost:9200/my\_index/\_settings](http://localhost:9200/my_index/_settings)'  
> > > > #\* create type\*  
> > > > \*curl -XPUT '[http://localhost:9200/my\_index/my\_type/\_mapping'-d](http://localhost:9200/my_index/my_type/_mapping'-d)
> > 
> > >
> 
> '{"my\_type":{"properties":{"title":{"type":"string"},"reference":{"type":"string",
> 
> > > > "index":"not\_analyzed"}}}}'\*
> > > > 
> > > > # check create type
> > > > 
> > > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_mapping](http://localhost:9200/my_index/my_type/_mapping)'
> > > > 
> > > > # _add data_
> > > > 
> > > > curl -XPUT '[http://localhost:9200/my\_index/my\_type/1'-d](http://localhost:9200/my_index/my_type/1'-d)  
> > > > '{"reference":"ADV-REF-00000001", "title":"Ingénieur Java"}'  
> > > > curl -XPUT '[http://localhost:9200/my\_index/my\_type/2'-d](http://localhost:9200/my_index/my_type/2'-d)  
> > > > '{"reference":"ADV-REF-00000002", "title":"Conservateur  
> > > > documentaliste"}'  
> > > > curl -XPUT '[http://localhost:9200/my\_index/my\_type/3'-d](http://localhost:9200/my_index/my_type/3'-d)  
> > > > '{"reference":"ADV-REF-00000003", "title":"Technicien qualité  
> > > > validation  
> > > > H/F"}'  
> > > > curl -XPUT '[http://localhost:9200/my\_index/my\_type/4'-d](http://localhost:9200/my_index/my_type/4'-d)  
> > > > '{"reference":"ADV-REF-00000004", "title":"Valet de chambre"}'  
> > > > curl -XPUT '[http://localhost:9200/my\_index/my\_type/5'-d](http://localhost:9200/my_index/my_type/5'-d)  
> > > > '{"reference":"ADV-REF-00000005", "title":"Ingénieur PHP"}'
> > > > 
> > > > # check add data
> > > > 
> > > > curl -XGET '[http://localhost:9200/my\_index/my\_type/1](http://localhost:9200/my_index/my_type/1)'
> > > > 
> > > > # _search data_
> > > > 
> > > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > > > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > > > "query":"title:_ingenieur_"}}}'  
> > > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > > > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > > > "query":"title:_ingénieur_"}}}'  
> > > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > > > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > > > "query":"title:_inge_"}}}'  
> > > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > > > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > > > "query":"title:_ingé_"}}}'  
> > > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > > > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > > > "query":"title:_Ingenieur_"}}}'  
> > > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > > > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > > > "query":"title:_Ingénieur_"}}}'  
> > > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > > > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > > > "query":"title:_Inge_"}}}'  
> > > > curl -XGET '[http://localhost:9200/my\_index/my\_type/\_search'-d](http://localhost:9200/my_index/my_type/_search'-d)  
> > > > '{"query":{"query\_string":{"analyze\_wildcard":"true",  
> > > > "query":"title:_Ingé_"}}}'
> > 
> > >
> 
> * * *
> 
> > > > I configured snowball, asciifolding, french\_stemmer on my index.
> > 
> > > > The queries should return 2 results corresponding to \_id=1 and \_id=5  
> > > > The first and the 5th return 0 result.
> > 
> > > > Any hint on what I am doing wrong ?
> > 
> > > > Thanks for your help,
> > 
> > > > --  
> > > > Cordialement/Regards,
> > 
> > > > Louis GUEYE  
> > > > linkedin [http://fr.linkedin.com/in/louisgueye](http://fr.linkedin.com/in/louisgueye) |  
> > > > blog[http://deepintojee.wordpress.com/](http://deepintojee.wordpress.com/)|  
> > > > twitter [http://twitter.com/#!/lgueye](http://twitter.com/#%21/lgueye)
> > 
> > --  
> > Cordialement/Regards,
> > 
> > Louis GUEYE  
> > linkedin [http://fr.linkedin.com/in/louisgueye](http://fr.linkedin.com/in/louisgueye) |  
> > blog[http://deepintojee.wordpress.com/](http://deepintojee.wordpress.com/)|  
> > twitter [http://twitter.com/#!/lgueye](http://twitter.com/#%21/lgueye)

--  
Cordialement/Regards,

Louis GUEYE  
linkedin [http://fr.linkedin.com/in/louisgueye](http://fr.linkedin.com/in/louisgueye) |  
blog[http://deepintojee.wordpress.com/](http://deepintojee.wordpress.com/)|  
twitter [http://twitter.com/#!/lgueye](http://twitter.com/#%21/lgueye)

---

<div class="post-metadata">

**Author:** ![louis\_gueye](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/louis_gueye/32/2772_2.png) [@louis\_gueye](https://discuss.elastic.co/u/louis_gueye)\
**Post date:** [February 7, 2012, 2:53pm UTC](https://discuss.elastic.co/t/configure-the-right-analyzer/6586/6 "2012-02-07T14:53:37Z")

</div>

I've created a gist to explain the desired behaviour.

In the gist I never figured out the right index settings that support  
"ignore accents" and "lowercase" both at "indexing" and searching phases.

Actually when I analyze "Ingénieur Java" it is correctly stored:  
{"tokens":[{"token":"ingenieur","start\_offset":0,"end\_offset":9,"type":"","position":1},{"token":"java","start\_offset":10,"end\_offset":14,"type":"","position":2}]}

But when I search with accent I have no hit:  
curl [http://localhost:9200/my\_index/my\_type/\_search?q=ingén\*](http://localhost:9200/my_index/my_type/_search?q=ing%C3%A9n*)

I really to get this feature working otherwise my client will never switch  
to elasticsearch.

Thx for your help.

--  
Cordialement/Regards,

Louis GUEYE  
linkedin [http://fr.linkedin.com/in/louisgueye](http://fr.linkedin.com/in/louisgueye) |  
blog[http://deepintojee.wordpress.com/](http://deepintojee.wordpress.com/)|  
twitter [http://twitter.com/#!/lgueye](http://twitter.com/#%21/lgueye)

---

<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 7, 2012, 6:52pm UTC](https://discuss.elastic.co/t/configure-the-right-analyzer/6586/7 "2012-02-07T18:52:25Z")

</div>

Where is the gist?

On Tuesday, February 7, 2012 at 4:53 PM, louis gueye wrote:

> I've created a gist to explain the desired behaviour.
> 
> In the gist I never figured out the right index settings that support "ignore accents" and "lowercase" both at "indexing" and searching phases.
> 
> Actually when I analyze "Ingénieur Java" it is correctly stored:  
> {"tokens":[{"token":"ingenieur","start\_offset":0,"end\_offset":9,"type":"","position":1},{"token":"java","start\_offset":10,"end\_offset":14,"type":"","position":2}]}
> 
> But when I search with accent I have no hit:  
> curl [http://localhost:9200/my\_index/my\_type/\_search?q=ingén](http://localhost:9200/my_index/my_type/_search?q=ing%C3%A9n)\* ([http://localhost:9200/my\_index/my\_type/\_search?q=ingén](http://localhost:9200/my_index/my_type/_search?q=ing%C3%A9n)\*)
> 
> I really to get this feature working otherwise my client will never switch to elasticsearch.
> 
> Thx for your help.
> 
> --  
> Cordialement/Regards,
> 
> Louis GUEYE  
> linkedin ([http://fr.linkedin.com/in/louisgueye](http://fr.linkedin.com/in/louisgueye)) | blog ([http://deepintojee.wordpress.com/](http://deepintojee.wordpress.com/)) | twitter ([http://twitter.com/#!/lgueye](http://twitter.com/#%21/lgueye))

---

<div class="post-metadata">

**Author:** ![louis\_gueye](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/louis_gueye/32/2772_2.png) [@louis\_gueye](https://discuss.elastic.co/u/louis_gueye)\
**Post date:** [February 7, 2012, 7:30pm UTC](https://discuss.elastic.co/t/configure-the-right-analyzer/6586/8 "2012-02-07T19:30:47Z")

</div>

A classic ☹ sorry.

> <https://gist.github.com/lgueye/1760014>

--  
Cordialement/Regards,

Louis GUEYE  
linkedin [http://fr.linkedin.com/in/louisgueye](http://fr.linkedin.com/in/louisgueye) |  
blog[http://deepintojee.wordpress.com/](http://deepintojee.wordpress.com/)  
| twitter [http://twitter.com/#!/lgueye](http://twitter.com/#%21/lgueye)

2012/2/7 Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com)

> Where is the gist?

---

<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 9, 2012, 6:58am UTC](https://discuss.elastic.co/t/configure-the-right-analyzer/6586/9 "2012-02-09T06:58:40Z")

</div>

It happens because you don't encode the special character properly when you provide it in the URL. Here are samples that work: [gist:1777975 · GitHub](https://gist.github.com/1777975).

On Tuesday, February 7, 2012 at 9:30 PM, louis gueye wrote:

> A classic ☹ sorry.
> 
> [elasticsearch : dealing with case and accents · GitHub](https://gist.github.com/1760014)
> 
> --  
> Cordialement/Regards,
> 
> Louis GUEYE  
> linkedin ([http://fr.linkedin.com/in/louisgueye](http://fr.linkedin.com/in/louisgueye)) | blog ([http://deepintojee.wordpress.com/](http://deepintojee.wordpress.com/)) | twitter ([http://twitter.com/#!/lgueye](http://twitter.com/#%21/lgueye))
> 
> 2012/2/7 Shay Banon \<[kimchy@gmail.com](mailto:kimchy@gmail.com) ([mailto:kimchy@gmail.com](mailto:kimchy@gmail.com))\>
> 
> > Where is the gist?

---

<div class="post-metadata">

**Author:** ![louis\_gueye](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/louis_gueye/32/2772_2.png) [@louis\_gueye](https://discuss.elastic.co/u/louis_gueye)\
**Post date:** [February 9, 2012, 10:25am UTC](https://discuss.elastic.co/t/configure-the-right-analyzer/6586/10 "2012-02-09T10:25:14Z")

</div>

Hi Shay,

Got it. What I understand is that \*accents can't be interpreted without \*\*  
wildcards \*\*analysis \* ...

I was hoping they could be because wildcard analysis is known to possibly  
be slow.

Anyway thanks a lot for your time.

When I have more time, I'll run more tests on accents and provide feedback.

Note : %e9 or %25e9 lead to the same result, they are found.

--  
Cordialement/Regards,

Louis GUEYE  
linkedin [http://fr.linkedin.com/in/louisgueye](http://fr.linkedin.com/in/louisgueye) |  
blog[http://deepintojee.wordpress.com/](http://deepintojee.wordpress.com/)  
| twitter [http://twitter.com/#!/lgueye](http://twitter.com/#%21/lgueye)

2012/2/9 Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com)

> It happens because you don't encode the special character properly when  
> you provide it in the URL. Here are samples that work:  
> [gist:1777975 · GitHub](https://gist.github.com/1777975).
> 
> On Tuesday, February 7, 2012 at 9:30 PM, louis gueye wrote:
> 
> A classic ☹ sorry.
> 
> [elasticsearch : dealing with case and accents · GitHub](https://gist.github.com/1760014)
> 
> --  
> Cordialement/Regards,
> 
> Louis GUEYE  
> linkedin [http://fr.linkedin.com/in/louisgueye](http://fr.linkedin.com/in/louisgueye) | blog[http://deepintojee.wordpress.com/](http://deepintojee.wordpress.com/)  
> | twitter [http://twitter.com/#!/lgueye](http://twitter.com/#%21/lgueye)
> 
> 2012/2/7 Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com)
> 
> Where is the gist?

---

<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:39am UTC](https://discuss.elastic.co/t/configure-the-right-analyzer/6586/11 "2017-07-06T03:39:58Z")

</div>


