Elasticsearch – Analyzer Part 2

Configure the built-in tokenizer

We can configure the built-in analyzers, some of them can be configured through parameters. In the following example, we will configure the standard analyzer to remove stop words.

We use the PUT verb and named the index “existing_analyzer_config”, and we add a request body. We want to configure an analyzer so we do this within an analyzer object, then we add a key for the name of the analyzer we want to add. Basically, we are defining our custom analyzer, but the analyzer is using the standard analyzer and we are just configuring it through parameters. We added a token filter here. That can be achieved by added a filter object within the analysis object. And now for checking our analyzer

Also, let’s check the filter

Build Custom Analyzer

The 10th line area of the code is the custom analyzer logic. This is our custom analyzer, to test it put the below in kibana and test.