Bypassing stemming while performing term suggestion

Hello,

kind of a newbie with ElasticSearch here. I'm trying to figure out how to avoid my search terms being stemmed right before the term suggestion phase.
My index settings/mapping look something like this:

{
  "settings":{
    "analysis":{
      "analyzer":{
        "my_custom_stemming_analyzer":{
          ...
        }
      }
    }
  },
  "mappings":{
    "_doc":{
      "_all":{
        "enabled":false
      },
      "properties":{
        "TARGET_FIELD":{
          "type":"text",
          "analyzer":"my_custom_stemming_analyzer"
        },
        "TARGET_FIELD_2":{
          "type":"text",
          "analyzer":"my_custom_stemming_analyzer"
        },
        ...
      }
    }
  }
}

This configuration works great for stemming-powered search, but if I submit this query:

{
  "from":0,
  "size":5,
  "query":{
    "bool":{
      "must":[
        {
          "multi_match":{
            "operator":"and",
            "fields":[
              "TARGET_FIELD^4",
              "TARGET_FIELD_2^2",
            ],
            "query":"stemming example"
          }
        }
      ]
    }
  },
  "suggest":{
    "my_suggester":{
      "text":"stemming example",
      "term":[{ "field":"TARGET_FIELD" },  { "field":"TARGET_FIELD_2" }]
    }
  }
}

the suggestions presented will be related to the already stemmed terms (e.g. I'm getting the suggestions for "stem" and "example"). Is there any way to get the suggestions from the original text, and not from the stemmed one?

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