How to stop words for the same root word

I want to stop all words from the root word "expect", for example, expected, expecting, expectation all shall be stopped.

Here is my mapping.
PUT /words_v1
{
"settings": {
"analysis": {
"analyzer": {
"extended_english_analyzer": {
"type": "english",
"stopwords": ["expect"]
}
}
}
},
"mappings": {
"words":{
"properties": {
"english": {
"type": "text",
"analyzer": "extended_english_analyzer",
"fielddata": true
}
}
}
}
}

Then I test it

GET /words_v1/_analyze?analyzer=extended_english_analyzer
{"text": "expected expecting"}

The result is
{
"tokens": [
{
"token": "expect",
"start_offset": 0,
"end_offset": 8,
"type": "",
"position": 0
},
{
"token": "expect",
"start_offset": 9,
"end_offset": 18,
"type": "",
"position": 1
}
]
}

You can see "expected" and "expecting" are still tokenized. I want they all be stopped.

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