Bug: intermittent empty highlights with allow_empty=true on distributed index containing local indexes with different morphology

Author: zhel1Created Aug 1, 2026Updated Aug 1, 2026
Labelsbug

Bug Description:

Bug: intermittent empty highlights with allow_empty=true on distributed index containing local indexes with different morphology

Version

Manticore Search 28.6.6

Description

When querying a distributed index that consists of local indexes with different morphology settings, highlight.allow_empty=true intermittently returns empty highlight arrays for the same matching document.

The matched document is always the same (_id and _score are identical), but the highlight section alternates between valid snippets and empty arrays.

The issue does not reproduce when querying the local index directly.

Schema

sql
CREATE TABLE full_text_search_ru (
    id bigint,
    title text,
    body text
)
min_infix_len='2'
index_exact_words='1'
morphology='lemmatize_ru_all'
stopwords_list='...';
sql
CREATE TABLE full_text_search_en (
    id bigint,
    title text,
    body text
)
min_infix_len='2'
index_exact_words='1'
morphology='lemmatize_en_all'
stopwords_list='...';
sql
CREATE TABLE full_text_search_zh_cn (
    id bigint,
    title text,
    body text
)
min_infix_len='2'
charset_table='chinese'
morphology='icu_chinese'
stopwords_list='...';
sql
CREATE TABLE full_text_search_all_ru_en_zh_cn
type='distributed'
local='full_text_search_ru'
local='full_text_search_en'
local='full_text_search_zh_cn';

Query

json
{
  "index": "full_text_search_all_ru_en_zh_cn",
  "query": {
    "query_string": "собака"
  },
  "limit": 1,
  "highlight": {
    "allow_empty": true,
    "fields": {
      "title": {},
      "body": {}
    }
  }
}

Actual behavior

Running the same request repeatedly produces different highlight results.

Sometimes:

json
"highlight": {
  "title": [],
  "body": []
}

Sometimes:

json
"highlight": {
  "title": [
    "...<em>собаки</em>..."
  ],
  "body": [
    "...<em>собаки</em>..."
  ]
}

The returned document is identical in both cases:

  • same _id
  • same _score
  • same search result

Only the highlight output changes.

Expected behavior

Highlight generation should be deterministic for identical requests.

If a document matches the query and snippets can be generated, they should always be returned.

allow_empty=true should only return empty highlights when no snippet exists, not intermittently for the same document.

Additional observations

  • The problem only occurs when querying the distributed table.
  • Querying full_text_search_ru directly does not reproduce the issue.
  • WEIGHT() remains identical across requests.
  • The problem appears to be related to distributed indexes composed of local indexes with different morphology settings.

Manticore Search Version:

28.6.6

Operating System Version:

ubuntu 26, docker image manticoresearch/manticore:28.6.6

Have you tried the latest development version?

No

Internal Checklist:

To be completed by the assignee. Check off tasks that have been completed or are not applicable.

  • Implementation completed
  • Tests developed
  • Documentation updated
  • Documentation reviewed

Source: manticoresoftware/manticoresearch