Elasticsearch's analysis tool describes analysis as the process of converting text into tokens, which are then added to the inverted index and used for searching. Every analysis is performed by an analyzer. For example, an index time analysis built in English will convert a sentence into distinct words; these distinct words are the tokens. Take the example of the following sentence:
Hello World! This is my first program and these are my first lines.
This will be added to the inverted index as the following:
[hello, world, first, program, these, line]
The analyzer removes the most frequent words and reduces words to the word stem—so lines becomes line. An analyzer can be specified in the mapping in the text field, as shown in the following query: