Stem override question

We have a fashion index. We do not want the word "shorts" to be stemmed to "short" in a search for shorts. "short" delivers "short dresses", "short sleeve shirts", etc. Can someone help provide and example of the rule(s) we would need to use to improve/narrow this search to "shorts" only?

Thanks in advance!

Joe

You can use the keyword marker filter to protect words from being stemmed. It is important that you place this filter before your stemmer in the analysis chain.

https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-keyword-marker-tokenfilter.html

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