# Highlighting not working correctly with greek analyzer

**URL:** <https://discuss.elastic.co/t/highlighting-not-working-correctly-with-greek-analyzer/382873>\
**Category:** Elasticsearch\
**Created:** [October 22, 2025, 7:21am UTC](https://discuss.elastic.co/t/highlighting-not-working-correctly-with-greek-analyzer/382873 "2025-10-22T07:21:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![epistola](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/epistola/32/144908_2.png) [@epistola](https://discuss.elastic.co/u/epistola)\
**Post date:** [October 22, 2025, 7:21am UTC](https://discuss.elastic.co/t/highlighting-not-working-correctly-with-greek-analyzer/382873/1 "2025-10-22T07:21:00Z")

</div>

Hello everyone,

I have a problem with the highlighting in Elasticsearch. I have a field in an index like the following:

```auto
"skepseis": {
	"type": "nested", 
	"properties": {
	  "text": {
		"type": "text",
		"analyzer": "greek"
	  }
	}
}

```

When the user searches with the terms "word1 word2" (where word1 and word2 are parts of the complete words) the correct document returns but the ES highlights only one of the words.

For example, when the user searches for "ΣΥΜΒΟΥΛ ΕΠΙΚΡΑΤ" (instead of "ΣΥΜΒΟΥΛΙΟ ΕΠΙΚΡΑΤΕΙΑΣ"), the ES highlights only the **ΣΥΜΒΟΥΛΙΟ** and not the **ΕΠΙΚΡΑΤΕΙΑΣ.**

I think that the problem has to do with the stemming of the two words. But i do not know how to change things to solve this.

The relevant code for highlighting is:

```auto
"inner_hits": {
	"name": f"matching_skepseis",
	"size": 10,               
	"highlight": {         
		"fields": {
			"skepseis.text": {"type": "unified"}
		}
	}
}

```

Any suggestions?

---

<div class="post-metadata">

**Author:** ![mayya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mayya/32/83147_2.png) [@mayya](https://discuss.elastic.co/u/mayya)\
**Post date:** [October 27, 2025, 8:13pm UTC](https://discuss.elastic.co/t/highlighting-not-working-correctly-with-greek-analyzer/382873/2 "2025-10-27T20:13:55Z")

</div>

Using \_analyze API, you can check how your original document gets analyzed:

```auto
GET <your_index>/_analyze
{
  "analyzer": "greek",
  "text": "ΣΥΜΒΟΥΛΙΟ ΕΠΙΚΡΑΤΕΙΑΣ"
}

```

Do you see different outputs from running analyze API on "ΣΥΜΒΟΥΛ ΕΠΙΚΡΑΤ?

If yes, then you should adjust your analyzer to produce the same output for both variations.

---

<div class="post-metadata">

**Author:** ![epistola](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/epistola/32/144908_2.png) [@epistola](https://discuss.elastic.co/u/epistola)\
**Post date:** [October 28, 2025, 10:07am UTC](https://discuss.elastic.co/t/highlighting-not-working-correctly-with-greek-analyzer/382873/3 "2025-10-28T10:07:38Z")

</div>

Yes they produce different tokens. Do you have any idea how to adjust the analyzer? I use the default greek one.

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![mayya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mayya/32/83147_2.png) [@mayya](https://discuss.elastic.co/u/mayya)\
**Post date:** [October 28, 2025, 7:37pm UTC](https://discuss.elastic.co/t/highlighting-not-working-correctly-with-greek-analyzer/382873/4 "2025-10-28T19:37:42Z")

</div>

You can NOT adjust greek analyzer; that is how it does stemming.

Looks like you are searching with prefixes. Consider using “search\_as\_you\_type” field type instead, that allows to search using prefixes.

```auto
"skepseis2": {
        "type": "nested",
        "properties": {
          "text": {
            "type": "search_as_you_type",
            "analyzer": "greek"
          }
        }
      }

```

Then you query could be:

```auto
GET /_search
{
  "query": {
    "nested": {
      "path": "skepseis2",
      "query": {
        "multi_match": {
          "query": "ΣΥΜΒΟΥΛ ΕΠΙΚΡΑΤ",
          "type": "bool_prefix",
          "fields": [
            "skepseis2.text",
            "skepseis2.text._2gram",
            "skepseis2.text._3gram"
          ]
        }
      },
      "inner_hits": {
        "name": "matching_skepseis2",
        "size": 10,
        "highlight": {
          "fields": {
            "skepseis2.text": {
              "type": "unified"
            }
          }
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![epistola](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/epistola/32/144908_2.png) [@epistola](https://discuss.elastic.co/u/epistola)\
**Post date:** [November 3, 2025, 7:06am UTC](https://discuss.elastic.co/t/highlighting-not-working-correctly-with-greek-analyzer/382873/5 "2025-11-03T07:06:18Z")

</div>

Thank you very much for your reply. Hope this solve the problem.

---

<div class="post-metadata">

**Author:** ![epistola](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/epistola/32/144908_2.png) [@epistola](https://discuss.elastic.co/u/epistola)\
**Post date:** [November 5, 2025, 8:10am UTC](https://discuss.elastic.co/t/highlighting-not-working-correctly-with-greek-analyzer/382873/6 "2025-11-05T08:10:31Z")

</div>

Unfortunately the type of the field (search\_as\_you\_type), due to the its length i suppose, it returns error during ingestion:

```auto
TransportError(429, 'circuit_breaking_exception', '[parent] Data too large, data for [<http_request>] would be [2090148108/1.9gb], which is larger than the limit of [2040109465/1.8gb], real usage: [2088466136/1.9gb], new bytes reserved: [1681972/1.6mb], usages [request=416530432/397.2mb, fielddata=4958016/4.7mb, in_flight_requests=1681972/1.6mb, model_inference=0/0b, accounting=2335104/2.2mb]') 

```
