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

KStem token filter

Provides KStem-based stemming for the English language. The kstem filter combines algorithmic stemming with a built-in dictionary.

The kstem filter tends to stem less aggressively than other English stemmer filters, such as the porter_stem filter.

The kstem filter is equivalent to the stemmer filter’s light_english variant.

This filter uses Lucene’s KStemFilter.

Example

The following analyze API request uses the kstem filter to stem the foxes jumping quickly to the fox jump quick:

GET /_analyze
{
  "tokenizer": "standard",
  "filter": [ "kstem" ],
  "text": "the foxes jumping quickly"
}

The filter produces the following tokens:

[ the, fox, jump, quick ]

Add to an analyzer

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

To work properly, the kstem filter requires lowercase tokens. To ensure tokens are lowercased, add the lowercase filter before the kstem filter in the analyzer configuration.

PUT /my-index-000001
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "tokenizer": "whitespace",
          "filter": [
            "lowercase",
            "kstem"
          ]
        }
      }
    }
  }
}

© 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-kstem-tokenfilter.html

Spec-Zone.ru

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