Improving the search experience using stemming

Stemming is the process where we convert an English word to its base form.

Some of the examples are shown as follows:

[ running , ran  ] => run
[ laughing ,  laugh , laughed ] => laugh

With this, our search would be a lot better. When someone searches for run, then all documents, no matter whether they consist the word running or ran, will also be shown as a match.

Note

This is possible because we apply the analyzer used for indexing on the search side too.

To achieve this, we have two approaches:

  • The algorithmic approach: In this approach, we use a generic language-based algorithm to convert words to their stems or base form
  • The dictionary-based approach: In this approach, we use a lookup mechanism to map ...

Get Elasticsearch Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.