DEV Community

loizenai
loizenai

Posted on

Elasticsearch Analyzers – Basic Analyzers

https://grokonez.com/elasticsearch/elasticsearch-analyzers-basic-analyzers

Elasticsearch Analyzers – Basic Analyzers

In this tutorial, we're gonna look at some basic analysers that Elasticsearch supports.

1. Keyword Analyzer

keyword analyzer returns the entire input string as a single token.


POST _analyze
{
  "analyzer": "keyword",
  "text": "Java Sample Approach"
}

Terms:


[ Java Sample Approach ]

2. Whitespace Analyzer

whitespace analyzer breaks text into terms whenever it encounters a whitespace character.


POST _analyze
{
  "analyzer": "whitespace",
  "text": "The Java Sample Approach's tutorials."
}

Terms:


[ The, Java, Sample, Approach's, tutorials. ]

3. Simple Analyzer

simple analyzer breaks text into lower cased terms whenever it encounters a character which is not a letter.


POST _analyze
{
  "analyzer": "simple",
  "text": "The Java Sample Approach's tutorials."
}

Terms:


[ the, java, sample, approach, s, tutorials ]

4. Stop Analyzer

stop analyzer is just like simple analyzer, but supports removing stop words (english stop words by default).


POST _analyze
{
  "analyzer": "stop",
  "text": "The Java Sample Approach's tutorials over years."
}

Terms:

more at:

https://grokonez.com/elasticsearch/elasticsearch-analyzers-basic-analyzers

Elasticsearch Analyzers – Basic Analyzers

Top comments (0)