# "apple" and the english analyzer

**URL:** <https://discuss.elastic.co/t/apple-and-the-english-analyzer/220753>\
**Category:** Elasticsearch\
**Created:** [February 25, 2020, 2:31am UTC](https://discuss.elastic.co/t/apple-and-the-english-analyzer/220753 "2020-02-25T02:31:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![emarthinsen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emarthinsen/32/23172_2.png) [@emarthinsen](https://discuss.elastic.co/u/emarthinsen)\
**Post date:** [February 25, 2020, 2:31am UTC](https://discuss.elastic.co/t/apple-and-the-english-analyzer/220753/1 "2020-02-25T02:31:48Z")

</div>

I'm not sure why ES is behaving like this. Here's my request:

```auto
GET /_analyze
{
	"analyzer": "english",
	"text": "apple"
}

```

And here's the response:

```auto
{
  "tokens": [
    {
      "token": "appl",
      "start_offset": 0,
      "end_offset": 5,
      "type": "<ALPHANUM>",
      "position": 0
    }
  ]
}

```

Does anyone know why `apple` is turning into `appl`?

BTW, I tried the same thing with `pineapple` and it turns into `pineappl`. Words like `pear`, `banana`, and `encyclopedia` come out just fine.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 25, 2020, 8:26am UTC](https://discuss.elastic.co/t/apple-and-the-english-analyzer/220753/2 "2020-02-25T08:26:24Z")

</div>

That's the effect of the english stemmer IMO.

Have a look at [https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-stemmer-tokenfilter.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-stemmer-tokenfilter.html)

There are other options for the stemmer. If the default one does not fit your needs.

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [February 25, 2020, 9:40am UTC](https://discuss.elastic.co/t/apple-and-the-english-analyzer/220753/3 "2020-02-25T09:40:15Z")

</div>

For background - stemming is used so that words like `meddle`, `meddled`, `meddling` and `meddles` are all turned into `meddl` in the index and can all match each other.

Not always useful though. I remember one situation where users were searching for Improvised Explosive Devices and the stemmer had turned all `IED`s into just `I`.

---

<div class="post-metadata">

**Author:** ![emarthinsen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emarthinsen/32/23172_2.png) [@emarthinsen](https://discuss.elastic.co/u/emarthinsen)\
**Post date:** [February 26, 2020, 9:05pm UTC](https://discuss.elastic.co/t/apple-and-the-english-analyzer/220753/4 "2020-02-26T21:05:44Z")

</div>

Interesting. I didn't realize that stemming would just lop off the part of the word that varies. I had expected it to normalize on the root word. The `meddle` example makes sense. I'm trying to figure out what other words `apple` shares a root with, other than `apples`. I feel like stemming would make `apple` and `apply` share the same stem of `appl`.

---

<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:** [March 25, 2020, 9:05pm UTC](https://discuss.elastic.co/t/apple-and-the-english-analyzer/220753/5 "2020-03-25T21:05:46Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
