0
0
Elasticsearchquery~5 mins

Standard analyzer in Elasticsearch

Choose your learning style9 modes available
Introduction

The standard analyzer helps break text into words so Elasticsearch can search and match them easily.

When you want to search normal text like articles or blog posts.
When you need to split sentences into words ignoring punctuation.
When you want a simple, general way to analyze text without special rules.
When you want to make searches case-insensitive and ignore common punctuation.
Syntax
Elasticsearch
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_standard_analyzer": {
          "type": "standard"
        }
      }
    }
  }
}
The standard analyzer splits text by spaces and punctuation.
It lowercases all words to make searching case-insensitive.
Examples
Set the default analyzer to standard for the whole index.
Elasticsearch
{
  "analyzer": {
    "default": {
      "type": "standard"
    }
  }
}
Create a custom analyzer named my_analyzer using the standard analyzer.
Elasticsearch
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "type": "standard"
        }
      }
    }
  }
}
Sample Program

This query shows how the standard analyzer breaks the text into words.

Elasticsearch
GET /_analyze
{
  "analyzer": "standard",
  "text": "Hello, World! This is Elasticsearch."
}
OutputSuccess
Important Notes

The standard analyzer removes punctuation and lowercases words.

It is good for general English text but may not fit special languages or needs.

Summary

The standard analyzer splits text into simple lowercase words.

It ignores punctuation and spaces to help search work better.

Use it when you want a basic, general text analyzer in Elasticsearch.