# Ukrainian analyzer

**URL:** https://discuss.elastic.co/t/ukrainian-analyzer/333062
**Category:** Elasticsearch
**Created:** [May 10, 2023, 9:56am UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062 "2023-05-10T09:56:06Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![Vladimir\_Talabko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimir_talabko/32/120862_2.png) [@Vladimir\_Talabko](https://discuss.elastic.co/u/Vladimir_Talabko)
#### Post date: [May 10, 2023, 9:56am UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/1 "2023-05-10T09:56:07Z")

</div>

Hello! I have a hosting with installed the Ukrainian plugin from this page [Ukrainian analysis plugin | Elasticsearch Plugins and Integrations [8.7] | Elastic](https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-ukrainian.html) .  
It's proven by this command:  
bin/elasticsearch-plugin list  
analysis-phonetic  
analysis-ukrainian  
However, I can't get it working.

```auto
brand3@vs2556:/usr/share/elasticsearch$ bin/elasticsearch-plugin list
analysis-phonetic
analysis-ukrainian
brand3@vs2556:/usr/share/elasticsearch$ curl -X GET "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
    "filter" : ["lowercase", "trim", {"type" : "stop", "stopwords" : "_ukrainian_"}, {"type" : "stemmer", "language" : "ukrainian"}],
    "tokenizer" : "standard",
    "text" : "Потужність двигуна"
}
'
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "Invalid stemmer class specified: Ukrainian"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "Invalid stemmer class specified: Ukrainian",
    "caused_by" : {
      "type" : "class_not_found_exception",
      "reason" : "org.tartarus.snowball.ext.UkrainianStemmer"
    }
  },
  "status" : 400
}

```

Could somebody give me a cue where I'm wrong, please?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 10, 2023, 10:16am UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/2 "2023-05-10T10:16:12Z")

</div>

Welcome!

Please don't post images of text as they are hard to read, may not display correctly for everyone, and are not searchable.

Instead, paste the text and format it with `</>` icon or pairs of triple backticks (```), and check the preview window to make sure it's properly formatted before posting it. This makes it more likely that your question will receive a useful answer.

It would be great if you could update your post to solve this.

What's the output of this?

```auto
GET /_cat/plugins?v=true&s=component&h=name,component,version,description

```

---

<div class="post-metadata">

### Author: ![Vladimir\_Talabko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimir_talabko/32/120862_2.png) [@Vladimir\_Talabko](https://discuss.elastic.co/u/Vladimir_Talabko)
#### Post date: [May 10, 2023, 12:01pm UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/3 "2023-05-10T12:01:41Z")

</div>

Thank you for answering. I've updated my original request.  
Your suggestion with the GET request shows the next:  
[1] 1696767  
[2] 1696768

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 10, 2023, 12:21pm UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/4 "2023-05-10T12:21:35Z")

</div>

You need to run that in Kibana Dev Console.

---

<div class="post-metadata">

### Author: ![Vladimir\_Talabko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimir_talabko/32/120862_2.png) [@Vladimir\_Talabko](https://discuss.elastic.co/u/Vladimir_Talabko)
#### Post date: [May 10, 2023, 12:27pm UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/5 "2023-05-10T12:27:47Z")

</div>

I don't have it. I have only the SSH access to my server and the support said that they have installed the plugin for the Ukrainian language and proved that as I have shown in my initial request.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 10, 2023, 12:50pm UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/6 "2023-05-10T12:50:52Z")

</div>

Run:

```
curl localhost:9200/_cat/plugins?v

```

---

<div class="post-metadata">

### Author: ![Vladimir\_Talabko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimir_talabko/32/120862_2.png) [@Vladimir\_Talabko](https://discuss.elastic.co/u/Vladimir_Talabko)
#### Post date: [May 10, 2023, 1:07pm UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/7 "2023-05-10T13:07:56Z")

</div>

```auto
name component version
vs2556.mirohost.net analysis-phonetic 7.17.9
vs2556.mirohost.net analysis-ukrainian 7.17.9
[1]- Exit 1 GET /_cat/plugins?v=true
[2]+ Done s=component

```

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 10, 2023, 1:49pm UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/8 "2023-05-10T13:49:08Z")

</div>

So I read the [documentation](https://www.elastic.co/guide/en/elasticsearch/plugins/7.17/analysis-ukrainian.html) and apparently this plugin provides an analyzer named `ukrainian` but not a stemmer with that name.

So I guess you can try something like:

```auto
curl -X GET "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
    "analyzer" : "ukrainian",
    "text" : "Потужність двигуна"
}
'

```

Only the analyzer is exposed by the plugin:

> <https://github.com/elastic/elasticsearch/blob/7.17/plugins/analysis-ukrainian/src/main/java/org/elasticsearch/plugin/analysis/ukrainian/AnalysisUkrainianPlugin.java#L23-L26>

---

<div class="post-metadata">

### Author: ![Vladimir\_Talabko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimir_talabko/32/120862_2.png) [@Vladimir\_Talabko](https://discuss.elastic.co/u/Vladimir_Talabko)
#### Post date: [May 10, 2023, 2:22pm UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/9 "2023-05-10T14:22:09Z")

</div>

Thank you. After all, it means that I need Java to be installed on my server. Could you provide which version of Java is supposed to be, please?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 10, 2023, 2:41pm UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/10 "2023-05-10T14:41:24Z")

</div>

I did not mean that...  
You just need to have the provided JVM available within the distribution.

Why do you want to install Java?

---

<div class="post-metadata">

### Author: ![Vladimir\_Talabko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimir_talabko/32/120862_2.png) [@Vladimir\_Talabko](https://discuss.elastic.co/u/Vladimir_Talabko)
#### Post date: [May 10, 2023, 2:44pm UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/11 "2023-05-10T14:44:28Z")

</div>

If I understood correctly, I need Java for this plugin [elasticsearch/AnalysisUkrainianPlugin.java at 7.17 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/blob/7.17/plugins/analysis-ukrainian/src/main/java/org/elasticsearch/plugin/analysis/ukrainian/AnalysisUkrainianPlugin.java#L23-L26)  
If not, what do you mean under JVM? I use a Unix hosting machine.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 10, 2023, 2:59pm UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/12 "2023-05-10T14:59:11Z")

</div>

You need Java if you want to modify/code/change this plugin.  
If you just want to use it, just do what I said:

```auto
curl -X GET "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
    "analyzer" : "ukrainian",
    "text" : "Потужність двигуна"
}
'

```

---

<div class="post-metadata">

### Author: ![Vladimir\_Talabko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimir_talabko/32/120862_2.png) [@Vladimir\_Talabko](https://discuss.elastic.co/u/Vladimir_Talabko)
#### Post date: [May 10, 2023, 3:03pm UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/13 "2023-05-10T15:03:40Z")

</div>

It means that there's not an opportunity in existence for using the stemming process for the Ukrainian language. Ok, I got it.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 10, 2023, 3:04pm UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/14 "2023-05-10T15:04:54Z")

</div>

But what is the output you are getting?  
Is it what you need?

---

<div class="post-metadata">

### Author: ![Vladimir\_Talabko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimir_talabko/32/120862_2.png) [@Vladimir\_Talabko](https://discuss.elastic.co/u/Vladimir_Talabko)
#### Post date: [May 10, 2023, 3:12pm UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/15 "2023-05-10T15:12:25Z")

</div>

I'm getting:

```auto
brand3@vs2556:/usr/share/elasticsearch$ curl -X GET "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
    "analyzer" : "ukrainian",
    "text" : "Потужність двигуна"
}
'
{
  "tokens" : [
    {
      "token" : "потужність",
      "start_offset" : 0,
      "end_offset" : 10,
      "type" : "<ALPHANUM>",
      "position" : 0
    },
    {
      "token" : "двигун",
      "start_offset" : 11,
      "end_offset" : 18,
      "type" : "<ALPHANUM>",
      "position" : 1
    }
  ]
}

```

but I supposed to get the main part of a word that I can achieve with the Russian language and its stemmer:

```auto
brand3@vs2556:/usr/share/elasticsearch$ curl -X GET "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
    "char_filter" : ["html_strip"],
    "filter" : ["lowercase", "trim", {"type" : "stop", "stopwords" : "_russian_"}, {"type" : "stemmer", "language" : "russian"}],
    "tokenizer" : "standard",
    "text" : "<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"table_technical_02\" style=\"width: 100%\">\t<tbody>\t\t<tr>\t\t\t<td class=\"tt_col_1\">Мощность двигателя в превеликий:<\/td>\t\t\t<td class=\"tt_col_2\">1,5 \u043a\u0412\u0442;<\/td>\t\t<\/tr>\t<\/tbody><\/table>"
}
'
{
  "tokens" : [
    {
      "token" : "мощност",
      "start_offset" : 135,
      "end_offset" : 143,
      "type" : "<ALPHANUM>",
      "position" : 0
    },
    {
      "token" : "двигател",
      "start_offset" : 144,
      "end_offset" : 153,
      "type" : "<ALPHANUM>",
      "position" : 1
    },
    {
      "token" : "превелик",
      "start_offset" : 156,
      "end_offset" : 166,
      "type" : "<ALPHANUM>",
      "position" : 3
    },
    {
      "token" : "1,5",
      "start_offset" : 196,
      "end_offset" : 199,
      "type" : "<NUM>",
      "position" : 4
    },
    {
      "token" : "квт",
      "start_offset" : 200,
      "end_offset" : 203,
      "type" : "<ALPHANUM>",
      "position" : 5
    }
  ]
}

```

for the word "Потужність" it's supposed to be "Потужн"

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 10, 2023, 3:19pm UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/16 "2023-05-10T15:19:58Z")

</div>

I see. That means that the built-in stemmer does not work as expected I guess.

This code (`UkrainianMorfologikAnalyzer`) is coming from [Lucene](https://github.com/apache/lucene/blob/main/lucene/analysis/morfologik/src/java/org/apache/lucene/analysis/uk/UkrainianMorfologikAnalyzer.java). I honestly don't know how to fix that problem.

May be you could open a github issue in Elasticsearch and describe there the text you are sending, what you are getting back and what you are supposed to get?

Or may be this should be better created in Lucene as Elasticsearch is "only" exposing it here...

---

<div class="post-metadata">

### Author: ![Vladimir\_Talabko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimir_talabko/32/120862_2.png) [@Vladimir\_Talabko](https://discuss.elastic.co/u/Vladimir_Talabko)
#### Post date: [May 10, 2023, 3:46pm UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/17 "2023-05-10T15:46:35Z")

</div>

Yep, I will try some future discovery and if I find something interesting I'll report here. Thank you!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [June 7, 2023, 3:47pm UTC](https://discuss.elastic.co/t/ukrainian-analyzer/333062/18 "2023-06-07T15:47:08Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
