Spec-Zone.ru › Elasticsearch 7
›Elasticsearch Guide [7.17] ›Text analysis ›Token filter reference

Lowercase token filter

Changes token text to lowercase. For example, you can use the lowercase filter to change THE Lazy DoG to the lazy dog.

In addition to a default filter, the lowercase token filter provides access to Lucene’s language-specific lowercase filters for Greek, Irish, and Turkish.

Example

The following analyze API request uses the default lowercase filter to change the THE Quick FoX JUMPs to lowercase:

GET _analyze
{
  "tokenizer" : "standard",
  "filter" : ["lowercase"],
  "text" : "THE Quick FoX JUMPs"
}

The filter produces the following tokens:

[ the, quick, fox, jumps ]

Add to an analyzer

The following create index API request uses the lowercase filter to configure a new custom analyzer.

PUT lowercase_example
{
  "settings": {
    "analysis": {
      "analyzer": {
        "whitespace_lowercase": {
          "tokenizer": "whitespace",
          "filter": [ "lowercase" ]
        }
      }
    }
  }
}

Configurable parameters

language

(Optional, string) Language-specific lowercase token filter to use. Valid values include:

greek
Uses Lucene’s GreekLowerCaseFilter
irish
Uses Lucene’s IrishLowerCaseFilter
turkish
Uses Lucene’s TurkishLowerCaseFilter

If not specified, defaults to Lucene’s LowerCaseFilter.

Customize

To customize the lowercase filter, duplicate it to create the basis for a new custom token filter. You can modify the filter using its configurable parameters.

For example, the following request creates a custom lowercase filter for the Greek language:

PUT custom_lowercase_example
{
  "settings": {
    "analysis": {
      "analyzer": {
        "greek_lowercase_example": {
          "type": "custom",
          "tokenizer": "standard",
          "filter": ["greek_lowercase"]
        }
      },
      "filter": {
        "greek_lowercase": {
          "type": "lowercase",
          "language": "greek"
        }
      }
    }
  }
}

© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/7.17/analysis-lowercase-tokenfilter.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API