# Avoid stemming analyzer at query time

**URL:** <https://discuss.elastic.co/t/avoid-stemming-analyzer-at-query-time/74150>\
**Category:** Elasticsearch\
**Created:** [February 7, 2017, 1:40am UTC](https://discuss.elastic.co/t/avoid-stemming-analyzer-at-query-time/74150 "2017-02-07T01:40:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lumberjack](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lumberjack/32/15263_2.png) [@Lumberjack](https://discuss.elastic.co/u/Lumberjack)\
**Post date:** [February 7, 2017, 1:40am UTC](https://discuss.elastic.co/t/avoid-stemming-analyzer-at-query-time/74150/1 "2017-02-07T01:40:25Z")

</div>

I am trying to use stopwords, synonym and stemming analyzers at index time but would like to avoid query time analyzer altogether (nothing more than a `standard` analyzer would do). Synonyms are defined in expanded form like `eat,gulp,swallow`

Here is my ideal setup:  
`default` analzyer which consists of stopwords, synonyms and stemming filters  
`default_search` analyzer which is of type `standard`

stopwords and synonyms work fine, however stemming does not.  
The problem with the above approach is the original (uninflected) information is lost after the stemming filter before indexing.

Is there any way/configuration to achieve my ideal setup (i.e. skipping stemming analyzer at query time)?

One alternative I thought of is to specify all stemming rules as synonyms in expanded form, but not sure if it is the best way to achieve it.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [February 7, 2017, 8:24am UTC](https://discuss.elastic.co/t/avoid-stemming-analyzer-at-query-time/74150/2 "2017-02-07T08:24:18Z")

</div>

Hey,

you can use [multi fields](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/mapping-types.html#_multi_fields) to index the same field in different ways, once with stemming applied, once with the standard analyzer. I think this could be more helpful in your case.

--Alex

---

<div class="post-metadata">

**Author:** ![Lumberjack](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lumberjack/32/15263_2.png) [@Lumberjack](https://discuss.elastic.co/u/Lumberjack)\
**Post date:** [February 7, 2017, 5:35pm UTC](https://discuss.elastic.co/t/avoid-stemming-analyzer-at-query-time/74150/3 "2017-02-07T17:35:18Z")

</div>

Hi,

Correct me if I am wrong, here is my understanding of using multi fields:

Indexing a field with multiple analyzers is accomplished via `mapping`. The problem with `mapping` is that the index-time analyzer is also used during query time.

Furthermore, let's assume the following index-time-only stemmer\_override:

```
ran=>run
runs=>run
running=>run

```

With the multi-field approach (assuming I am specifying `standard` analyzer in the query itself), if I search for `run`, I'd get back the results for all the variations. However, if I search for any original term, e.g. `ran`, wouldn't it skip `runs` and `running`?

---

<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 7, 2017, 5:35pm UTC](https://discuss.elastic.co/t/avoid-stemming-analyzer-at-query-time/74150/4 "2017-03-07T17:35:47Z")

</div>

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