# Problème with french stemmer

**URL:** <https://discuss.elastic.co/t/probleme-with-french-stemmer/4726>\
**Category:** Elasticsearch\
**Created:** [June 28, 2011, 6:53pm UTC](https://discuss.elastic.co/t/probleme-with-french-stemmer/4726 "2011-06-28T18:53:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandre\_Heimburger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexandre_heimburger/32/2941_2.png) [@Alexandre\_Heimburger](https://discuss.elastic.co/u/Alexandre_Heimburger)\
**Post date:** [June 28, 2011, 6:53pm UTC](https://discuss.elastic.co/t/probleme-with-french-stemmer/4726/1 "2011-06-28T18:53:24Z")

</div>

Hi,

I work on a "search as you type" box.

Many users are indexed.

For example, when I type : Fre

I should get Docteur Freud, Frédéric Durand, Jean Frérac.... all these  
names matching Fre / Fré / Frê etc....

I tried to use a custom analyzer with a light french stemmer but I can  
only get Frédéric if I type Fré.

You will find the configuration in the associated gist.

Thanks for your help.

> <https://gist.github.com/alheim/fffe05c43db6fb5f16c9>

---

<div class="post-metadata">

**Author:** ![rmuir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rmuir/32/44949_2.png) [@rmuir](https://discuss.elastic.co/u/rmuir)\
**Post date:** [June 28, 2011, 7:31pm UTC](https://discuss.elastic.co/t/probleme-with-french-stemmer/4726/2 "2011-06-28T19:31:13Z")

</div>

On Tue, Jun 28, 2011 at 2:53 PM, alheim [alexheimburger@gmail.com](mailto:alexheimburger@gmail.com) wrote:

> Hi,
> 
> I work on a "search as you type" box.
> 
> Many users are indexed.
> 
> For example, when I type : Fre
> 
> I should get Docteur Freud, Frédéric Durand, Jean Frérac.... all these  
> names matching Fre / Fré / Frê etc....
> 
> I tried to use a custom analyzer with a light french stemmer but I can  
> only get Frédéric if I type Fré.

prefix queries do not go thru the lucene analyzer... so if this is  
your use case for this field I would not recommend stemming it!

P.S. you might want to consider using something more efficient for  
search-as-you-type, lucene's wildcards are slow and I think you would  
find edge-ngrams much faster.

---

<div class="post-metadata">

**Author:** ![Alexandre\_Heimburger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexandre_heimburger/32/2941_2.png) [@Alexandre\_Heimburger](https://discuss.elastic.co/u/Alexandre_Heimburger)\
**Post date:** [June 29, 2011, 6:35am UTC](https://discuss.elastic.co/t/probleme-with-french-stemmer/4726/3 "2011-06-29T06:35:43Z")

</div>

Thx Robert. Can you explain how to use the edge-ngrams in my context ?

On Tue, Jun 28, 2011 at 9:31 PM, Robert Muir [rcmuir@gmail.com](mailto:rcmuir@gmail.com) wrote:

> On Tue, Jun 28, 2011 at 2:53 PM, alheim [alexheimburger@gmail.com](mailto:alexheimburger@gmail.com) wrote:
> 
> > Hi,
> > 
> > I work on a "search as you type" box.
> > 
> > Many users are indexed.
> > 
> > For example, when I type : Fre
> > 
> > I should get Docteur Freud, Frédéric Durand, Jean Frérac.... all these  
> > names matching Fre / Fré / Frê etc....
> > 
> > I tried to use a custom analyzer with a light french stemmer but I can  
> > only get Frédéric if I type Fré.
> 
> prefix queries do not go thru the lucene analyzer... so if this is  
> your use case for this field I would not recommend stemming it!
> 
> P.S. you might want to consider using something more efficient for  
> search-as-you-type, lucene's wildcards are slow and I think you would  
> find edge-ngrams much faster.

--  
Alexandre Heimburger  
R&D Manager  
blueKiwi Software  
tel : +33687880997  
email : [ahb@bluekiwi-software.com](mailto:ahb@bluekiwi-software.com)  
adress : 93 rue Vieille du Temple, 75003 Paris

What is blueKiwi? blueKiwi - the first Enterprise Social Software Suite in  
the world building professional networks on conversations and relationships

- helps large organizations increase their productivity, foster innovations  
and boost people satisfaction.

---

<div class="post-metadata">

**Author:** ![Alexandre\_Heimburger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexandre_heimburger/32/2941_2.png) [@Alexandre\_Heimburger](https://discuss.elastic.co/u/Alexandre_Heimburger)\
**Post date:** [June 29, 2011, 7:55am UTC](https://discuss.elastic.co/t/probleme-with-french-stemmer/4726/4 "2011-06-29T07:55:10Z")

</div>

Ok. The n-gram filter works fine.

But I still have a problem with the stemmer.

If I index "élève" :

- if I search "elev", there is a result (I think elev is the stemmer  
representation of élève)
- if I search "élève", there is no result (wierd)

Here is the new gist.

> <https://gist.github.com/aheimburger/98fccd76d8b4b1b1f0b1>

On 29 juin, 08:35, Alexandre Heimburger [alexheimbur...@gmail.com](mailto:alexheimbur...@gmail.com)  
wrote:

> Thx Robert. Can you explain how to use the edge-ngrams in my context ?
> 
> On Tue, Jun 28, 2011 at 9:31 PM, Robert Muir [rcm...@gmail.com](mailto:rcm...@gmail.com) wrote:
> 
> > On Tue, Jun 28, 2011 at 2:53 PM, alheim [alexheimbur...@gmail.com](mailto:alexheimbur...@gmail.com) wrote:
> > 
> > > Hi,
> 
> > > I work on a "search as you type" box.
> 
> > > Many users are indexed.
> 
> > > For example, when I type : Fre
> 
> > > I should get Docteur Freud, Frédéric Durand, Jean Frérac.... all these  
> > > names matching Fre / Fré / Frê etc....
> 
> > > I tried to use a custom analyzer with a light french stemmer but I can  
> > > only get Frédéric if I type Fré.
> 
> > prefix queries do not go thru the lucene analyzer... so if this is  
> > your use case for this field I would not recommend stemming it!
> 
> > P.S. you might want to consider using something more efficient for  
> > search-as-you-type, lucene's wildcards are slow and I think you would  
> > find edge-ngrams much faster.
> 
> --  
> Alexandre Heimburger  
> R&D Manager  
> blueKiwi Software  
> tel : +33687880997  
> email : [a...@bluekiwi-software.com](mailto:a...@bluekiwi-software.com)  
> adress : 93 rue Vieille du Temple, 75003 Paris
> 
> What is blueKiwi? blueKiwi - the first Enterprise Social Software Suite in  
> the world building professional networks on conversations and relationships
> 
> - helps large organizations increase their productivity, foster innovations  
> and boost people satisfaction.

---

<div class="post-metadata">

**Author:** ![rmuir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rmuir/32/44949_2.png) [@rmuir](https://discuss.elastic.co/u/rmuir)\
**Post date:** [June 29, 2011, 8:16am UTC](https://discuss.elastic.co/t/probleme-with-french-stemmer/4726/5 "2011-06-29T08:16:42Z")

</div>

On Wed, Jun 29, 2011 at 3:55 AM, alheim [alexheimburger@gmail.com](mailto:alexheimburger@gmail.com) wrote:

> Ok. The n-gram filter works fine.
> 
> But I still have a problem with the stemmer.
> 
> If I index "élève" :
> 
> - if I search "elev", there is a result (I think elev is the stemmer  
> representation of élève)
> - if I search "élève", there is no result (wierd)
> 
> Here is the new gist.
> 
> [Stemmer issue · GitHub](https://gist.github.com/98fccd76d8b4b1b1f0b1)

why do you still want the stemmer? It does not make sense to me for  
autocomplete, so I would remove it!

---

<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, 4:02am UTC](https://discuss.elastic.co/t/probleme-with-french-stemmer/4726/6 "2017-07-06T04:02:20Z")

</div>


