# English stemming

**URL:** <https://discuss.elastic.co/t/english-stemming/4760>\
**Category:** Elasticsearch\
**Created:** [July 3, 2011, 6:51am UTC](https://discuss.elastic.co/t/english-stemming/4760 "2011-07-03T06:51:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Berkhout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_berkhout/32/3058_2.png) [@Chris\_Berkhout](https://discuss.elastic.co/u/Chris_Berkhout)\
**Post date:** [July 3, 2011, 6:51am UTC](https://discuss.elastic.co/t/english-stemming/4760/1 "2011-07-03T06:51:48Z")

</div>

I'm trying to get basic English stemming to work.

Words like 'and' get filtered out, but I can't stem plurals or conjugations.

Here's a recreation of an unexpected result:

> <https://gist.github.com/chrisberkhout/5021c5c7ef129be73346>

I've tried several alternative configs from the docs. Any ideas?

Cheers,  
Chris

---

<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:** [July 3, 2011, 12:28pm UTC](https://discuss.elastic.co/t/english-stemming/4760/2 "2011-07-03T12:28:21Z")

</div>

Hi Chris

> Here's a recreation of an unexpected result:  
> [stemming problem with snowball · GitHub](https://gist.github.com/5021c5c7ef129be73346)

Unfortunately, index settings will accept any values, and store them.  
It doesn't throw an error if it doesn't recognise the settings.

Try this to set the default analyzer for your index to 'english' (which  
is a lighter version of the snowball stemmer):

curl -XPUT '[http://127.0.0.1:9200/test/?pretty=1](http://127.0.0.1:9200/test/?pretty=1)' -d '  
{  
"settings" : {  
"analysis" : {  
"analyzer" : {  
"default" : {  
"type" : "english"  
}  
}  
}  
}  
}  
'

Then you can test it with the analyze API:

curl -XGET '[http://127.0.0.1:9200/test/\_analyze?pretty=1&text=the+fox+jumps](http://127.0.0.1:9200/test/_analyze?pretty=1&text=the+fox+jumps)'

# [Sun Jul 3 14:27:44 2011] Response:

# {

# "tokens" : [

# {

# "end\_offset" : 7,

# "position" : 2,

# "start\_offset" : 4,

# "type" : "",

# "token" : "fox"

# },

# {

# "end\_offset" : 13,

# "position" : 3,

# "start\_offset" : 8,

# "type" : "",

# "token" : "jump"

# }

# ]

# }

clint

---

<div class="post-metadata">

**Author:** ![Chris\_Berkhout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_berkhout/32/3058_2.png) [@Chris\_Berkhout](https://discuss.elastic.co/u/Chris_Berkhout)\
**Post date:** [July 3, 2011, 3:06pm UTC](https://discuss.elastic.co/t/english-stemming/4760/3 "2011-07-03T15:06:18Z")

</div>

Thanks!

Yeah, that's a bit tricky. I hadn't really expected an error message, but  
when I saw the settings in there (via elasticsearch-head \> info \> metadata \>  
settings), I'd assumed that they were correctly recognised.

Anyway, this does work, and for now I don't need anything more fancy.

Cheers,  
Chris

On Sun, Jul 3, 2011 at 8:28 PM, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> Hi Chris
> 
> > Here's a recreation of an unexpected result:  
> > [stemming problem with snowball · GitHub](https://gist.github.com/5021c5c7ef129be73346)
> 
> Unfortunately, index settings will accept any values, and store them.  
> It doesn't throw an error if it doesn't recognise the settings.
> 
> Try this to set the default analyzer for your index to 'english' (which  
> is a lighter version of the snowball stemmer):
> 
> curl -XPUT '[http://127.0.0.1:9200/test/?pretty=1](http://127.0.0.1:9200/test/?pretty=1)' -d '  
> {  
> "settings" : {  
> "analysis" : {  
> "analyzer" : {  
> "default" : {  
> "type" : "english"  
> }  
> }  
> }  
> }  
> }  
> '
> 
> Then you can test it with the analyze API:
> 
> curl -XGET '  
> [http://127.0.0.1:9200/test/\_analyze?pretty=1&text=the+fox+jumps](http://127.0.0.1:9200/test/_analyze?pretty=1&text=the+fox+jumps)'
> 
> # [Sun Jul 3 14:27:44 2011] Response:
> 
> # {
> 
> # "tokens" : [
> 
> # {
> 
> # "end\_offset" : 7,
> 
> # "position" : 2,
> 
> # "start\_offset" : 4,
> 
> # "type" : "",
> 
> # "token" : "fox"
> 
> # },
> 
> # {
> 
> # "end\_offset" : 13,
> 
> # "position" : 3,
> 
> # "start\_offset" : 8,
> 
> # "type" : "",
> 
> # "token" : "jump"
> 
> # }
> 
> # ]
> 
> # }
> 
> clint

---

<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:01am UTC](https://discuss.elastic.co/t/english-stemming/4760/4 "2017-07-06T04:01:56Z")

</div>


