October 2019
Beginner
186 pages
5h 39m
English
A whitespace analyzer breaks the text into terms when it encounters whitespace characters:
POST _analyze { "analyzer": "whitespace", "text": "This is my first program and these are my first 5 lines."}
This will result in the following terms:
[this, is, my, first, program, and, these, are, my, first, 5, lines]
This analyzer cannot be configured. To alter it, users must create a custom analyzer that mimics the whitespace analyzer, and then add filters to it. As you can see in the following expression, we can add filters to the analyzer:
PUT whitespace_example { "settings": { "analysis": { "analyzer": { "rebuilt_simple": { "tokenizer": "whitespace", "filter": [--add filter tokens here] } } } }}
Read now
Unlock full access