# Stemming Problem

**URL:** <https://discuss.elastic.co/t/stemming-problem/8842>\
**Category:** Elasticsearch\
**Created:** [August 24, 2012, 6:11am UTC](https://discuss.elastic.co/t/stemming-problem/8842 "2012-08-24T06:11:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ezyrider42](https://avatars.discourse-cdn.com/v4/letter/e/a5b964/32.png) [@ezyrider42](https://discuss.elastic.co/u/ezyrider42)\
**Post date:** [August 24, 2012, 6:11am UTC](https://discuss.elastic.co/t/stemming-problem/8842/1 "2012-08-24T06:11:33Z")

</div>

Hi All,

I am having a problem getting stemming working with my index with the  
snowball analyzer.

If I use the analyzer directly, I get a stemmed version:  
curl -XGET 'localhost:9200/\_analyze?analyzer=snowball&pretty=1' -d  
'intermingling'  
{  
"tokens" : [ {  
"token" : "intermingl",  
"start\_offset" : 0,  
"end\_offset" : 13,  
"type" : "",  
"position" : 1  
} ]

If I use the index I get, there is no stemming:  
curl -XGET 'localhost:9200/test/\_analyze?pretty=1' -d 'intermingling'  
{  
"tokens" : [ {  
"token" : "intermingling",  
"start\_offset" : 0,  
"end\_offset" : 13,  
"type" : "",  
"position" : 1  
} ]

Here are the settings for the index:

curl -XGET '[http://localhost:9200/test/\_settings?pretty=1](http://localhost:9200/test/_settings?pretty=1)''  
{  
"test" : {  
"settings" : {  
"index.analysis.analyzer.testsnowball\_analyzer.type" : "snowball",  
"index.analysis.analyzer.testsnowball\_analyzer.language" : "English",  
"index.number\_of\_shards" : "5",  
"index.number\_of\_replicas" : "1",  
"index.version.created" : "190899",  
"index.refresh\_interval" : "-1"  
}  
}

What am I doing wrong?

Thanks,  
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:** [August 24, 2012, 6:24am UTC](https://discuss.elastic.co/t/stemming-problem/8842/2 "2012-08-24T06:24:13Z")

</div>

> If I use the index I get, there is no stemming:  
> curl -XGET 'localhost:9200/test/\_analyze?pretty=1' -d 'intermingling'

You're not specifying which analyzer to use.

Try:

curl -XGET 'localhost:9200/test/\_analyze?pretty=1&analyzer=testsnowball' -d 'intermingling'

Similarly, your analyzer won't be applied to any fields unless you  
specify that in the mapping for those fields.

clint

--

---

<div class="post-metadata">

**Author:** ![ezyrider42](https://avatars.discourse-cdn.com/v4/letter/e/a5b964/32.png) [@ezyrider42](https://discuss.elastic.co/u/ezyrider42)\
**Post date:** [August 24, 2012, 5:12pm UTC](https://discuss.elastic.co/t/stemming-problem/8842/3 "2012-08-24T17:12:48Z")

</div>

Thanks! I am specifying the analyzer for the index. What does that do?  
Doesn't that apply it to all the fields in the index?  
Thanks,  
Chris

On Thursday, August 23, 2012 11:24:13 PM UTC-7, Clinton Gormley wrote:

> > If I use the index I get, there is no stemming:  
> > curl -XGET 'localhost:9200/test/\_analyze?pretty=1' -d 'intermingling'
> 
> You're not specifying which analyzer to use.
> 
> Try:
> 
> curl -XGET 'localhost:9200/test/\_analyze?pretty=1&analyzer=testsnowball'  
> -d 'intermingling'
> 
> Similarly, your analyzer won't be applied to any fields unless you  
> specify that in the mapping for those fields.
> 
> clint

--

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [August 24, 2012, 5:56pm UTC](https://discuss.elastic.co/t/stemming-problem/8842/4 "2012-08-24T17:56:37Z")

</div>

Hi Chris,

Technically you are only specifying an analyzer that could be used in  
that index. In order for it to be used, a field could be mapped to it  
(as Clinton described), or it can be specified as the default  
analyzer:

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

I have never overridden the default analyzer, so I am curious about  
how it works with the analyze API.

Cheers,

Ivan

On Fri, Aug 24, 2012 at 10:12 AM, ezyrider42 [ezyrider42@gmail.com](mailto:ezyrider42@gmail.com) wrote:

> Thanks! I am specifying the analyzer for the index. What does that do?  
> Doesn't that apply it to all the fields in the index?  
> Thanks,  
> Chris
> 
> On Thursday, August 23, 2012 11:24:13 PM UTC-7, Clinton Gormley wrote:
> 
> > > If I use the index I get, there is no stemming:  
> > > curl -XGET 'localhost:9200/test/\_analyze?pretty=1' -d 'intermingling'
> > 
> > You're not specifying which analyzer to use.
> > 
> > Try:
> > 
> > curl -XGET 'localhost:9200/test/\_analyze?pretty=1&analyzer=testsnowball'  
> > -d 'intermingling'
> > 
> > Similarly, your analyzer won't be applied to any fields unless you  
> > specify that in the mapping for those fields.
> > 
> > clint
> 
> --

--

---

<div class="post-metadata">

**Author:** ![ezyrider42](https://avatars.discourse-cdn.com/v4/letter/e/a5b964/32.png) [@ezyrider42](https://discuss.elastic.co/u/ezyrider42)\
**Post date:** [August 24, 2012, 6:06pm UTC](https://discuss.elastic.co/t/stemming-problem/8842/5 "2012-08-24T18:06:53Z")

</div>

Thanks, do you have an example of how the default analyzer is specified?

Cheers,  
Chris

On Friday, August 24, 2012 10:56:37 AM UTC-7, Ivan Brusic wrote:

> Hi Chris,
> 
> Technically you are only specifying an analyzer that could be used in  
> that index. In order for it to be used, a field could be mapped to it  
> (as Clinton described), or it can be specified as the default  
> analyzer:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/analysis/)
> 
> I have never overridden the default analyzer, so I am curious about  
> how it works with the analyze API.
> 
> Cheers,
> 
> Ivan
> 
> On Fri, Aug 24, 2012 at 10:12 AM, ezyrider42 \<[ezyri...@gmail.com](mailto:ezyri...@gmail.com)\<javascript:\>\>  
> wrote:
> 
> > Thanks! I am specifying the analyzer for the index. What does that do?  
> > Doesn't that apply it to all the fields in the index?  
> > Thanks,  
> > Chris
> > 
> > On Thursday, August 23, 2012 11:24:13 PM UTC-7, Clinton Gormley wrote:
> > 
> > > > If I use the index I get, there is no stemming:  
> > > > curl -XGET 'localhost:9200/test/\_analyze?pretty=1' -d 'intermingling'
> > > 
> > > You're not specifying which analyzer to use.
> > > 
> > > Try:
> > > 
> > > curl -XGET  
> > > 'localhost:9200/test/\_analyze?pretty=1&analyzer=testsnowball'  
> > > -d 'intermingling'
> > > 
> > > Similarly, your analyzer won't be applied to any fields unless you  
> > > specify that in the mapping for those fields.
> > > 
> > > clint
> > 
> > --

--

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [August 24, 2012, 6:31pm UTC](https://discuss.elastic.co/t/stemming-problem/8842/6 "2012-08-24T18:31:40Z")

</div>

Never done it myself, so I had to search for it. This post seems to  
have the answer:

[https://groups.google.com/d/msg/elasticsearch/SgHVv6cjZ6w/89c9hlzwlpEJ](https://groups.google.com/d/msg/elasticsearch/SgHVv6cjZ6w/89c9hlzwlpEJ)

On Fri, Aug 24, 2012 at 11:06 AM, ezyrider42 [ezyrider42@gmail.com](mailto:ezyrider42@gmail.com) wrote:

> Thanks, do you have an example of how the default analyzer is specified?
> 
> Cheers,  
> Chris
> 
> On Friday, August 24, 2012 10:56:37 AM UTC-7, Ivan Brusic wrote:
> 
> > Hi Chris,
> > 
> > Technically you are only specifying an analyzer that could be used in  
> > that index. In order for it to be used, a field could be mapped to it  
> > (as Clinton described), or it can be specified as the default  
> > analyzer:
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/analysis/)
> > 
> > I have never overridden the default analyzer, so I am curious about  
> > how it works with the analyze API.
> > 
> > Cheers,
> > 
> > Ivan
> > 
> > On Fri, Aug 24, 2012 at 10:12 AM, ezyrider42 [ezyri...@gmail.com](mailto:ezyri...@gmail.com) wrote:
> > 
> > > Thanks! I am specifying the analyzer for the index. What does that do?  
> > > Doesn't that apply it to all the fields in the index?  
> > > Thanks,  
> > > Chris
> > > 
> > > On Thursday, August 23, 2012 11:24:13 PM UTC-7, Clinton Gormley wrote:
> > > 
> > > > > If I use the index I get, there is no stemming:  
> > > > > curl -XGET 'localhost:9200/test/\_analyze?pretty=1' -d 'intermingling'
> > > > 
> > > > You're not specifying which analyzer to use.
> > > > 
> > > > Try:
> > > > 
> > > > curl -XGET  
> > > > 'localhost:9200/test/\_analyze?pretty=1&analyzer=testsnowball'  
> > > > -d 'intermingling'
> > > > 
> > > > Similarly, your analyzer won't be applied to any fields unless you  
> > > > specify that in the mapping for those fields.
> > > > 
> > > > clint
> > > 
> > > --
> 
> --

--

---

<div class="post-metadata">

**Author:** ![ezyrider42](https://avatars.discourse-cdn.com/v4/letter/e/a5b964/32.png) [@ezyrider42](https://discuss.elastic.co/u/ezyrider42)\
**Post date:** [August 24, 2012, 8:42pm UTC](https://discuss.elastic.co/t/stemming-problem/8842/7 "2012-08-24T20:42:58Z")

</div>

That seems to work, Thanks!

On Friday, August 24, 2012 11:31:40 AM UTC-7, Ivan Brusic wrote:

> Never done it myself, so I had to search for it. This post seems to  
> have the answer:
> 
> [https://groups.google.com/d/msg/elasticsearch/SgHVv6cjZ6w/89c9hlzwlpEJ](https://groups.google.com/d/msg/elasticsearch/SgHVv6cjZ6w/89c9hlzwlpEJ)
> 
> On Fri, Aug 24, 2012 at 11:06 AM, ezyrider42 \<[ezyri...@gmail.com](mailto:ezyri...@gmail.com)\<javascript:\>\>  
> wrote:
> 
> > Thanks, do you have an example of how the default analyzer is specified?
> > 
> > Cheers,  
> > Chris
> > 
> > On Friday, August 24, 2012 10:56:37 AM UTC-7, Ivan Brusic wrote:
> > 
> > > Hi Chris,
> > > 
> > > Technically you are only specifying an analyzer that could be used in  
> > > that index. In order for it to be used, a field could be mapped to it  
> > > (as Clinton described), or it can be specified as the default  
> > > analyzer:
> > > 
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/analysis/)
> > > 
> > > I have never overridden the default analyzer, so I am curious about  
> > > how it works with the analyze API.
> > > 
> > > Cheers,
> > > 
> > > Ivan
> > > 
> > > On Fri, Aug 24, 2012 at 10:12 AM, ezyrider42 [ezyri...@gmail.com](mailto:ezyri...@gmail.com)  
> > > wrote:
> > > 
> > > > Thanks! I am specifying the analyzer for the index. What does that  
> > > > do?  
> > > > Doesn't that apply it to all the fields in the index?  
> > > > Thanks,  
> > > > Chris
> > > > 
> > > > On Thursday, August 23, 2012 11:24:13 PM UTC-7, Clinton Gormley  
> > > > wrote:
> > > > 
> > > > > > If I use the index I get, there is no stemming:  
> > > > > > curl -XGET 'localhost:9200/test/\_analyze?pretty=1' -d  
> > > > > > 'intermingling'
> > > > > 
> > > > > You're not specifying which analyzer to use.
> > > > > 
> > > > > Try:
> > > > > 
> > > > > curl -XGET  
> > > > > 'localhost:9200/test/\_analyze?pretty=1&analyzer=testsnowball'  
> > > > > -d 'intermingling'
> > > > > 
> > > > > Similarly, your analyzer won't be applied to any fields unless you  
> > > > > specify that in the mapping for those fields.
> > > > > 
> > > > > 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, 3:15am UTC](https://discuss.elastic.co/t/stemming-problem/8842/8 "2017-07-06T03:15:06Z")

</div>


