Analysis in elasticsearch comes into context when you are willing to analyze the data in your index.
Analyzers allow us to perform following:
We will be looking at each of them now.
Abbreviations:
Using analyzers, we can tell elasticsearch how to treat abbreviations in our data i.e. dr => Doctor so whenever we search for doctor keyword in our index, elasticsearch will also return the results which have dr mentioned in them.
Stemming:
Using stemming in analyzers allows us to use base words for modified verbs like
Word | Modifications |
---|---|
require | requirement,required |
Typo Handling:
Analyzers also provide typo handling as while querying if we are searching for particular word say 'resurrection', then elasticsearch will return the results in which typos are present.i.e. it will treat typos like resurection,ressurection as same and will retun the result.
Word | Modifications |
---|---|
resurrection | resurection,ressurection |
Analyzers in Elasticsearch
Standard
Simple
Whitespace
Stop
Keyword
Pattern
Language
Snowball