# Highlighting on ES8 much slower than ES7

**URL:** <https://discuss.elastic.co/t/highlighting-on-es8-much-slower-than-es7/375355>\
**Category:** Elasticsearch\
**Tags:** runtime-fields\
**Created:** [March 4, 2025, 9:32am UTC](https://discuss.elastic.co/t/highlighting-on-es8-much-slower-than-es7/375355 "2025-03-04T09:32:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bartosz\_Krakowiak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bartosz_krakowiak/32/141735_2.png) [@Bartosz\_Krakowiak](https://discuss.elastic.co/u/Bartosz_Krakowiak)\
**Post date:** [March 4, 2025, 9:32am UTC](https://discuss.elastic.co/t/highlighting-on-es8-much-slower-than-es7/375355/1 "2025-03-04T09:32:06Z")

</div>

Hi,  
I've updated my cluster from Elasticsearch 7.17.16 to 8.16.3 and noticed that Kibana is working way slower in ES 8, because most of the query time is spent in HighlightingPhase. The difference is even bigger when using wildcards. Index settings and mappings are the same on both versions. The index is quite small: 8,202,224 docs, 1.36gb storage size.

Mapping:

```auto
{
  "mappings": {
    "_doc": {
      "dynamic": "strict",
      "properties": {
        "alternateUrls": {
          "type": "nested",
          "properties": {
            "alternateDefinitionType": {
              "type": "text"
            },
            "alternateLocale": {
              "type": "text"
            },
            "targetName": {
              "type": "text"
            },
            "targetType": {
              "type": "text"
            },
            "targetValue": {
              "type": "text"
            }
          }
        },
        "alternateUrlsRawForQuickSearch": {
          "type": "text"
        },
        "boxConditions": {
          "type": "nested",
          "properties": {
            "device": {
              "type": "text"
            },
            "experimentExpectedVariant": {
              "type": "text"
            },
            "experimentId": {
              "type": "text"
            },
            "experimentParameterName": {
              "type": "text"
            },
            "experimentParameterValue": {
              "type": "text"
            },
            "expression": {
              "type": "text"
            },
            "fromDate": {
              "type": "date",
              "format": "yyyy-MM-dd'T'HH:mm:ss.SSSSSSXXX"
            },
            "guestFlag": {
              "type": "boolean"
            },
            "isTrue": {
              "type": "boolean"
            },
            "localeCode": {
              "type": "text"
            },
            "toDate": {
              "type": "date",
              "format": "yyyy-MM-dd'T'HH:mm:ss.SSSSSSXXX"
            },
            "type": {
              "type": "text"
            },
            "userTraitHash": {
              "type": "text"
            },
            "userTraitValue": {
              "type": "text"
            }
          }
        },
        "boxConditionsRawForQuickSearch": {
          "type": "text"
        },
        "dataSourceAcceptMediaTypes": {
          "type": "text"
        },
        "dataSourceAllowCustomParams": {
          "type": "boolean"
        },
        "dataSourceAllowsPassingPageUrlParams": {
          "type": "boolean"
        },
        "dataSourceCategory": {
          "type": "text"
        },
        "dataSourceDataTypeName": {
          "type": "text"
        },
        "dataSourceDataTypeVersion": {
          "type": "version"
        },
        "dataSourceDescription": {
          "type": "text"
        },
        "dataSourceDomain": {
          "type": "text"
        },
        "dataSourceIcon": {
          "type": "text"
        },
        "dataSourceId": {
          "type": "text"
        },
        "dataSourceInterfaces": {
          "type": "text"
        },
        "dataSourceIsDeprecated": {
          "type": "boolean"
        },
        "dataSourceOAuthMode": {
          "type": "text"
        },
        "dataSourcePassRenderingContext": {
          "type": "text"
        },
        "dataSourceServiceName": {
          "type": "text"
        },
        "dataSourceTimeoutInMillis": {
          "type": "integer"
        },
        "dataSourceTitle": {
          "type": "text"
        },
        "dataSourceUrl": {
          "type": "text"
        },
        "dictionaryKey": {
          "type": "text"
        },
        "dictionaryLanguageCode": {
          "type": "text"
        },
        "dictionaryValue": {
          "type": "text"
        },
        "id": {
          "type": "integer"
        },
        "isPublished": {
          "type": "boolean"
        },
        "name": {
          "type": "keyword"
        },
        "nodeId": {
          "type": "text"
        },
        "pageUrlParameters": {
          "type": "nested",
          "properties": {
            "canonical": {
              "type": "boolean"
            },
            "defaultValue": {
              "type": "text"
            },
            "description": {
              "type": "text"
            },
            "maxValue": {
              "type": "double"
            },
            "minValue": {
              "type": "double"
            },
            "name": {
              "type": "text"
            },
            "required": {
              "type": "boolean"
            },
            "screenParameterName": {
              "type": "text"
            },
            "type": {
              "type": "text"
            },
            "valueMask": {
              "type": "text"
            }
          }
        },
        "pageUrlParametersRawForQuickSearch": {
          "type": "text"
        },
        "parameters": {
          "type": "nested",
          "properties": {
            "name": {
              "type": "text"
            },
            "sourceOfParameter": {
              "type": "text"
            },
            "type": {
              "type": "text"
            },
            "value": {
              "type": "text"
            }
          }
        },
        "parametersRawForQuickSearch": {
          "type": "text"
        },
        "prototypeId": {
          "type": "text"
        },
        "prototypeKind": {
          "type": "text"
        },
        "prototypeName": {
          "type": "text"
        },
        "prototypeVersion": {
          "type": "version"
        },
        "publicationRoutes": {
          "type": "text"
        },
        "redirects": {
          "type": "nested",
          "properties": {
            "conditionName": {
              "type": "text"
            },
            "conditionType": {
              "type": "text"
            },
            "conditionValue": {
              "type": "text"
            },
            "locationName": {
              "type": "text"
            },
            "locationType": {
              "type": "text"
            },
            "locationValue": {
              "type": "text"
            }
          }
        },
        "redirectsRawForQuickSearch": {
          "type": "text"
        },
        "relativeDefinitionUrl": {
          "type": "text"
        },
        "relativeDefinitionUrlForBox": {
          "type": "text"
        },
        "relativeDefinitionUrlForDataSource": {
          "type": "text"
        },
        "siteName": {
          "type": "text"
        },
        "snapshotAuthor": {
          "type": "text"
        },
        "snapshotCreatedAt": {
          "type": "date",
          "format": "yyyy-MM-dd'T'HH:mm:ss.SSSSSSXXX"
        },
        "sourceTab": {
          "type": "text"
        },
        "spaceName": {
          "type": "text"
        },
        "type": {
          "type": "text"
        }
      }
    }
  }
}

```

Settings:

```auto
  "settings": {
    "index": {
      "routing": {
        "allocation": {
          "include": {
            "_tier_preference": "data_content"
          }
        }
      },
      "number_of_shards": "1",
      "provided_name": "index-1",
      "analysis": {
        "analyzer": {
          "default": {
            "filter": [
              "lowercase"
            ],
            "type": "custom",
            "tokenizer": "whitespace"
          }
        }
      },
      "number_of_replicas": "1",
      "uuid": "..",
      "version": {
        "created": "7171199"
      }
    }
  },

```

Query:

```auto
POST /search-alias/_search
{
  "profile": true,
  "track_total_hits": true,
  "sort": [
    {
      "_score": {
        "order": "desc"
      }
    }
  ],
  "fields": [
    {
      "field": "*",
      "include_unmapped": true
    },
    {
      "field": "boxConditions.fromDate",
      "format": "strict_date_optional_time"
    },
    {
      "field": "boxConditions.toDate",
      "format": "strict_date_optional_time"
    },
    {
      "field": "snapshotCreatedAt",
      "format": "strict_date_optional_time"
    }
  ],
  "size": 500,
  "version": true,
  "_source": false,
  "stored_fields": [
    "*"
  ],
  "query": {
    "bool": {
      "must": [
        {
          "query_string": {
            "query": "search phrase test"
          }
        }
      ],
      "filter": [],
      "should": [],
      "must_not": []
    }
  },
  "highlight": {
    "pre_tags": [
      "@kibana-highlighted-field@"
    ],
    "post_tags": [
      "@/kibana-highlighted-field@"
    ],
    "fields": {
      "*": {}
    },
    "fragment_size": 2147483647
  },
  "runtime_mappings": {},
  "script_fields": {}
}

```

Response ES7:

```auto
  "hits" : {
    "total" : {
      "value" : 6557,
      "relation" : "eq"
    },
...
              "type" : "HighlightPhase",
              "description" : "",
              "time_in_nanos" : 287429894,
              "breakdown" : {
                "process_count" : 500,
                "process" : 287424040,
                "next_reader" : 5854,
                "next_reader_count" : 8
              }

```

Response ES8:

```auto
            {
              "type": "HighlightPhase",
              "description": "",
              "time_in_nanos": 1291815787,
              "breakdown": {
                "process_count": 500,
                "process": 1291804079,
                "next_reader": 11708,
                "next_reader_count": 15
              }
            },

```

HighlightingPhase takes 4.5 times longer.  
When the query changes to `"query": "*search phrase test*"`, difference is even bigger.  
Reponse ES7 2:

```auto
            {
              "type" : "HighlightPhase",
              "description" : "",
              "time_in_nanos" : 440599218,
              "breakdown" : {
                "process_count" : 500,
                "process" : 440591589,
                "next_reader" : 7629,
                "next_reader_count" : 9
              }
            }

```

Response ES8 2:

```auto
            {
              "type": "HighlightPhase",
              "description": "",
              "time_in_nanos": 43822082892,
              "breakdown": {
                "process_count": 500,
                "process": 43822062829,
                "next_reader": 20063,
                "next_reader_count": 14
              }
            },

```

Now it takes 100x longer, 440ms on ES7 and 43s on ES8.

Is this a bug or can I do something to fix this performance? Kibana is significantly slower.

---

<div class="post-metadata">

**Author:** ![colmose](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colmose/32/144973_2.png) [@colmose](https://discuss.elastic.co/u/colmose)\
**Post date:** [September 10, 2025, 8:18am UTC](https://discuss.elastic.co/t/highlighting-on-es8-much-slower-than-es7/375355/2 "2025-09-10T08:18:22Z")

</div>

I also have the same issue with a large increase in the highlight phase between ES7 and ES8. The queries in question would be similar to @Bartosz_Krakowiak ‘s queries above.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/4/74c2990128a9be3d7783a9ee167de57262a2dbf9.png)

There is a screenshot of a quick 10 iteration benchmark with a `“unified”` highlighter between the two versions.

Data, mappings, index settings etc are the same across the two. You can see the query below.

> **Query**
>
> ```json
> {
> "track_total_hits": true,
> "_source": false,
> "timeout": "30s",
> "size": 100,
> "profile": true,
> "query": {
> "bool": {
> "must": [
> {
> "bool": {
> "should": [
> {
> "bool": {
> "must": [
> {
> "range": {
> "founded_date": {
> "format": "strict_date_optional_time",
> "gte": "1875-08-18T17:56:00.000Z",
> "lt": "2025-08-18T16:32:00.000Z"
> }
> }
> }
> ]
> }
> }
> ]
> }
> },
> {
> "bool": {
> "should": [
> {
> "simple_query_string": {
> "lenient": true,
> "query": "\"google\"",
> "boost": 10000,
> "fields": [
> "blog_feed_url^10",
> "blog_url^10",
> "category_code^10",
> "city^10",
> "company.category_code^10",
> "company.name.label^10",
> "company.name.label.raw^10",
> "countrycode^10",
> "description^10",
> "email_address^10",
> "freebaseid^10",
> "hasstatus^10",
> "homepage_url^10",
> "id^10",
> "label^10",
> "label-not-analyzed^10",
> "label.raw^10",
> "one_competitor^10",
> "overview^10",
> "permalink^10",
> "phone_number^10",
> "revenue^10",
> "revenuecurrency^10",
> "revenuedate^10",
> "statecode^10",
> "url^10",
> "webpage^10"
> ]
> }
> },
> {
> "simple_query_string": {
> "lenient": true,
> "query": "(google~2|google*)",
> "default_operator": "AND",
> "fields": [
> "blog_feed_url^10",
> "blog_url^10",
> "category_code^10",
> "city^10",
> "company.category_code^10",
> "company.name.label^10",
> "company.name.label.raw^10",
> "countrycode^10",
> "description^10",
> "email_address^10",
> "freebaseid^10",
> "hasstatus^10",
> "homepage_url^10",
> "id^10",
> "label^10",
> "label-not-analyzed^10",
> "label.raw^10",
> "one_competitor^10",
> "overview^10",
> "permalink^10",
> "phone_number^10",
> "revenue^10",
> "revenuecurrency^10",
> "revenuedate^10",
> "statecode^10",
> "url^10",
> "webpage^10"
> ]
> }
> }
> ]
> }
> }
> ]
> }
> },
> "highlight": {
> "pre_tags": [
> "@kibana-highlighted-field@"
> ],
> "post_tags": [
> "@/kibana-highlighted-field@"
> ],
> "fields": {
> "*": {
> "type": "unified"
> }
> },
> "fragment_size": 150,
> "number_of_fragments": 2,
> "highlight_query": {
> "bool": {
> "should": [
> {
> "simple_query_string": {
> "lenient": true,
> "query": "\"google\"",
> "boost": 10000,
> "fields": [
> "blog_feed_url^10",
> "blog_url^10",
> "category_code^10",
> "city^10",
> "company.category_code^10",
> "company.name.label^10",
> "company.name.label.raw^10",
> "countrycode^10",
> "description^10",
> "email_address^10",
> "freebaseid^10",
> "hasstatus^10",
> "homepage_url^10",
> "id^10",
> "label^10",
> "label-not-analyzed^10",
> "label.raw^10",
> "one_competitor^10",
> "overview^10",
> "permalink^10",
> "phone_number^10",
> "revenue^10",
> "revenuecurrency^10",
> "revenuedate^10",
> "statecode^10",
> "url^10",
> "webpage^10"
> ]
> }
> },
> {
> "simple_query_string": {
> "lenient": true,
> "query": "(google~2|google*)",
> "default_operator": "AND",
> "fields": [
> "blog_feed_url^10",
> "blog_url^10",
> "category_code^10",
> "city^10",
> "company.category_code^10",
> "company.name.label^10",
> "company.name.label.raw^10",
> "countrycode^10",
> "description^10",
> "email_address^10",
> "freebaseid^10",
> "hasstatus^10",
> "homepage_url^10",
> "id^10",
> "label^10",
> "label-not-analyzed^10",
> "label.raw^10",
> "one_competitor^10",
> "overview^10",
> "permalink^10",
> "phone_number^10",
> "revenue^10",
> "revenuecurrency^10",
> "revenuedate^10",
> "statecode^10",
> "url^10",
> "webpage^10"
> ]
> }
> }
> ]
> }
> }
> },
> "aggs": {
> "dynamicfilter:56462ec0-9526-11ee-96b0-037b3e4468df": {
> "terms": {
> "field": "countrycode",
> "size": 138,
> "shard_size": 138
> }
> },
> "dynamicfilter:94195c90-9526-11ee-96b0-037b3e4468df": {
> "terms": {
> "field": "city",
> "size": 138,
> "shard_size": 138
> }
> },
> "dynamicfilter:1fc40fb0-9527-11ee-96b0-037b3e4468df": {
> "terms": {
> "field": "category_code",
> "size": 138,
> "shard_size": 138
> }
> },
> "dynamicfilter:d6eaa870-9527-11ee-96b0-037b3e4468df": {
> "range": {
> "field": "number_of_employees",
> "ranges": [
> {
> "key": "*-10",
> "to": 10
> },
> {
> "key": "10-50",
> "from": 10,
> "to": 50
> },
> {
> "key": "50-100",
> "from": 50,
> "to": 100
> },
> {
> "key": "100-500",
> "from": 100,
> "to": 500
> },
> {
> "key": "500-1000",
> "from": 500,
> "to": 1000
> },
> {
> "key": "1000-5000",
> "from": 1000,
> "to": 5000
> },
> {
> "key": "5000-10000",
> "from": 5000,
> "to": 10000
> },
> {
> "key": "10000-100000",
> "from": 10000,
> "to": 100000
> },
> {
> "key": "100000-200000",
> "from": 100000,
> "to": 200000
> },
> {
> "key": "200000-400000",
> "from": 200000,
> "to": 400000
> },
> {
> "key": "400000-*",
> "from": 400000
> }
> ]
> }
> }
> },
> "stored_fields": [
> "*"
> ],
> "script_fields": {},
> "docvalue_fields": [
> {
> "field": "deadpooled_date",
> "format": "date_optional_time"
> },
> {
> "field": "founded_date",
> "format": "date_optional_time"
> },
> "id",
> {
> "field": "record_date",
> "format": "date_optional_time"
> }
> ]
> 
> ```

From experimenting with `“plain”` vs `“unified”` highlighting across 7.x and 8.x, it seems ES7 `“unified”` is fastest but by far the slowest on ES8.

Help in at least understanding the regression in performance would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![john-wagster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john-wagster/32/139021_2.png) [@john-wagster](https://discuss.elastic.co/u/john-wagster)\
**Post date:** [September 14, 2025, 4:04am UTC](https://discuss.elastic.co/t/highlighting-on-es8-much-slower-than-es7/375355/3 "2025-09-14T04:04:06Z")

</div>

@Bartosz_Krakowiak sorry I missed this earlier in the year. Not sure if you are available but happy to discuss your situation still here.

@colmose does seem like you might be seeing the same issue. There are potentially some things that could have caused the regression.

One particular thing both of you could try that I’m aware of is related to this issue:

> <https://github.com/elastic/elasticsearch/issues/120565>
>
> \### Elasticsearch Version
> 
> 8.10.0
> 
> \### Installed Plugins
> 
> analysis-kuromoji,anal…ysis-smartcn,analysis-nori
> 
> \### Java Version
> 
> \_bundled\_
> 
> \### OS Version
> 
> Linux es-data-i-xxxxx 6.1.119-129.201.amzn2023.aarch64 #1 SMP Tue Dec 3 21:06:52 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
> 
> \### Problem Description
> 
> After upgrading from 8.6.1 to 8.16.1 we noticed a massive drop in performance of the queries. Search requests that were taking ~200ms on 8.6.1 started to take over 9 seconds:
> 
> \<img src="https://github.com/user-attachments/assets/cafaea01-2620-4dc7-9b10-a1e99dfb15bb" width="1050px" /\>
> 
> The search phase of the query on 8.16.1 was still taking the same time as before, the slow down is associated with the highlight phase taking over 9 seconds:
> \`\`\`json
> {
> "type": "HighlightPhase",
> "description": "",
> "time\_in\_nanos": 9640635470,
> "breakdown": {
> "process\_count": 10,
> "process": 9640634394,
> "next\_reader": 1076,
> "next\_reader\_count": 2
> }
> }
> \`\`\`
> 
> After bisecting all the versions between 8.6.1 and 8.16.1 we discovered that the issue was introduced in 8.10.0. With the only change to highlight code being this PR https://github.com/elastic/elasticsearch/pull/96068
> 
> With \`require\_field\_match: false\` query does get faster but still takes over a second. However, upon fully disabling \`index.highlight.weight\_matches\_mode.enabled: false\` performance issue is fully mitigated: query time drops down to ~200ms and CPU on the cluster data nodes goes down:
> 
> \<img src="https://github.com/user-attachments/assets/09aa2cf1-be30-4962-93fb-c2290c54f33f" width="450px" /\>
> 
> \<img src="https://github.com/user-attachments/assets/f2554224-7f4e-4ec1-8ebe-6a84d7b2e680" width="650px" /\>
> 
> Hot threads data:
> \`\`\`
> Hot threads at 2025-01-21T22:57:18.120Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true:
> 
> 100.0% \[cpu=92.7%, other=7.3%\] (500ms out of 500ms) cpu usage by thread 'elasticsearch\[qMac-4.local\]\[search\]\[T#3\]'
> 2/10 snapshots sharing following 45 elements
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.util.automaton.Operations.getLiveStatesToAccept(Operations.java:974)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.util.automaton.Operations.getLiveStates(Operations.java:926)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.util.automaton.Operations.removeDeadStates(Operations.java:1007)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.util.automaton.LevenshteinAutomata.toAutomaton(LevenshteinAutomata.java:220)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.FuzzyAutomatonBuilder.buildAutomatonSet(FuzzyAutomatonBuilder.java:63)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.FuzzyTermsEnum$AutomatonAttributeImpl.init(FuzzyTermsEnum.java:391)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.FuzzyTermsEnum.\<init\>(FuzzyTermsEnum.java:149)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.FuzzyTermsEnum.\<init\>(FuzzyTermsEnum.java:126)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.FuzzyQuery.getTermsEnum(FuzzyQuery.java:208)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.MultiTermQuery$RewriteMethod.getTermsEnum(MultiTermQuery.java:67)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.TermCollectingRewrite.collectTerms(TermCollectingRewrite.java:57)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.TopTermsRewrite.rewrite(TopTermsRewrite.java:67)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.MultiTermQuery.rewrite(MultiTermQuery.java:325)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.BooleanQuery.rewrite(BooleanQuery.java:293)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.DisjunctionMaxQuery.rewrite(DisjunctionMaxQuery.java:234)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.BoostQuery.rewrite(BoostQuery.java:76)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.BooleanQuery.rewrite(BooleanQuery.java:293)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java:799)
> app/org.apache.lucene.highlighter@9.7.0/org.apache.lucene.search.uhighlight.FieldOffsetStrategy.createOffsetsEnumsWeightMatcher(FieldOffsetStrategy.java:145)
> app/org.apache.lucene.highlighter@9.7.0/org.apache.lucene.search.uhighlight.FieldOffsetStrategy.createOffsetsEnumFromReader(FieldOffsetStrategy.java:74)
> app/org.apache.lucene.highlighter@9.7.0/org.apache.lucene.search.uhighlight.MemoryIndexOffsetStrategy.getOffsetsEnum(MemoryIndexOffsetStrategy.java:119)
> app/org.apache.lucene.highlighter@9.7.0/org.apache.lucene.search.uhighlight.FieldHighlighter.highlightFieldForDoc(FieldHighlighter.java:80)
> \`\`\`
> 
> \`\`\`
> Hot threads at 2025-01-21T22:58:05.892Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true:
> 
> 100.0% \[cpu=88.2%, other=11.8%\] (500ms out of 500ms) cpu usage by thread 'elasticsearch\[qMac-4.local\]\[search\]\[T#11\]'
> 4/10 snapshots sharing following 43 elements
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.FuzzyAutomatonBuilder.buildAutomatonSet(FuzzyAutomatonBuilder.java:63)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.FuzzyTermsEnum$AutomatonAttributeImpl.init(FuzzyTermsEnum.java:391)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.FuzzyTermsEnum.\<init\>(FuzzyTermsEnum.java:149)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.FuzzyTermsEnum.\<init\>(FuzzyTermsEnum.java:126)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.FuzzyQuery.getTermsEnum(FuzzyQuery.java:208)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.MultiTermQuery$RewriteMethod.getTermsEnum(MultiTermQuery.java:67)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.TermCollectingRewrite.collectTerms(TermCollectingRewrite.java:57)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.TopTermsRewrite.rewrite(TopTermsRewrite.java:67)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.MultiTermQuery.rewrite(MultiTermQuery.java:325)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.BooleanQuery.rewrite(BooleanQuery.java:293)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.DisjunctionMaxQuery.rewrite(DisjunctionMaxQuery.java:234)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.BoostQuery.rewrite(BoostQuery.java:76)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.BooleanQuery.rewrite(BooleanQuery.java:293)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.ConstantScoreQuery.rewrite(ConstantScoreQuery.java:44)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.BooleanQuery.rewrite(BooleanQuery.java:288)
> app/org.apache.lucene.core@9.7.0/org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java:799)
> app/org.apache.lucene.highlighter@9.7.0/org.apache.lucene.search.uhighlight.FieldOffsetStrategy.createOffsetsEnumsWeightMatcher(FieldOffsetStrategy.java:145)
> app/org.apache.lucene.highlighter@9.7.0/org.apache.lucene.search.uhighlight.FieldOffsetStrategy.createOffsetsEnumFromReader(FieldOffsetStrategy.java:74)
> app/org.apache.lucene.highlighter@9.7.0/org.apache.lucene.search.uhighlight.MemoryIndexOffsetStrategy.getOffsetsEnum(MemoryIndexOffsetStrategy.java:119)
> app/org.apache.lucene.highlighter@9.7.0/org.apache.lucene.search.uhighlight.FieldHighlighter.highlightFieldForDoc(FieldHighlighter.java:80)
> \`\`\`
> 
> \### Steps to Reproduce
> 
> Query:
> \`\`\`json
> {
> "profile": false,
> "query": {
> "bool": {
> "filter": {
> "bool": {
> "must": \[
> {
> "term": {
> "app\_id": 123456789
> }
> },
> {
> "term": {
> "state": "published"
> }
> },
> {
> "term": {
> "visible": true
> }
> }
> \],
> "should": \[
> {
> "multi\_match": {
> "fields": \[
> "title",
> "summary",
> "heading\_text",
> "subheading\_text",
> "body\_text"
> \],
> "query": "TEXT",
> "type": "bool\_prefix"
> }
> },
> {
> "multi\_match": {
> "fields": \[
> "title.full\_words^2.5",
> "summary.full\_words^2",
> "heading\_text.full\_words^1.5",
> "subheading\_text.full\_words^1.5",
> "body\_text.full\_words"
> \],
> "query": "TEXT",
> "type": "phrase",
> "minimum\_should\_match": "50%",
> "slop": 50,
> "boost": 10
> }
> },
> {
> "multi\_match": {
> "fields": \[
> "title.full\_words^2.5",
> "summary.full\_words^2",
> "heading\_text.full\_words^1.5",
> "subheading\_text.full\_words^1.5",
> "body\_text.full\_words"
> \],
> "query": "TEXT",
> "type": "best\_fields",
> "boost": 7
> }
> },
> {
> "multi\_match": {
> "fields": \[
> "title.analyzed\_shingle^2.5",
> "summary.analyzed\_shingle^2",
> "heading\_text.analyzed\_shingle^1.5",
> "subheading\_text.analyzed\_shingle^1.5",
> "body\_text.analyzed\_shingle"
> \],
> "query": "TEXT",
> "type": "phrase",
> "minimum\_should\_match": "50%",
> "slop": 50,
> "boost": 5
> }
> },
> {
> "multi\_match": {
> "fields": \[
> "title.analyzed\_unigram^2.5",
> "summary.analyzed\_unigram^2",
> "heading\_text.analyzed\_unigram^1.5",
> "subheading\_text.analyzed\_unigram^1.5",
> "body\_text.analyzed\_unigram"
> \],
> "query": "TEXT",
> "type": "best\_fields",
> "analyzer": "query\_analyzer",
> "boost": 1
> }
> },
> {
> "multi\_match": {
> "fields": \[
> "title",
> "summary",
> "heading\_text",
> "subheading\_text",
> "body\_text"
> \],
> "query": "TEXT",
> "type": "best\_fields",
> "boost": 0.2,
> "fuzziness": "auto",
> "prefix\_length": 3
> }
> }
> \],
> "minimum\_should\_match": 1
> }
> },
> "should": \[
> {
> "multi\_match": {
> "fields": \[
> "title",
> "summary",
> "heading\_text",
> "subheading\_text",
> "body\_text"
> \],
> "query": "TEXT",
> "type": "bool\_prefix"
> }
> },
> {
> "multi\_match": {
> "fields": \[
> "title.full\_words^2.5",
> "summary.full\_words^2",
> "heading\_text.full\_words^1.5",
> "subheading\_text.full\_words^1.5",
> "body\_text.full\_words"
> \],
> "query": "TEXT",
> "type": "phrase",
> "minimum\_should\_match": "50%",
> "slop": 50,
> "boost": 10
> }
> },
> {
> "multi\_match": {
> "fields": \[
> "title.full\_words^2.5",
> "summary.full\_words^2",
> "heading\_text.full\_words^1.5",
> "subheading\_text.full\_words^1.5",
> "body\_text.full\_words"
> \],
> "query": "TEXT",
> "type": "best\_fields",
> "boost": 7
> }
> },
> {
> "multi\_match": {
> "fields": \[
> "title.analyzed\_shingle^2.5",
> "summary.analyzed\_shingle^2",
> "heading\_text.analyzed\_shingle^1.5",
> "subheading\_text.analyzed\_shingle^1.5",
> "body\_text.analyzed\_shingle"
> \],
> "query": "TEXT",
> "type": "phrase",
> "minimum\_should\_match": "50%",
> "slop": 50,
> "boost": 5
> }
> },
> {
> "multi\_match": {
> "fields": \[
> "title.analyzed\_unigram^2.5",
> "summary.analyzed\_unigram^2",
> "heading\_text.analyzed\_unigram^1.5",
> "subheading\_text.analyzed\_unigram^1.5",
> "body\_text.analyzed\_unigram"
> \],
> "query": "TEXT",
> "type": "best\_fields",
> "analyzer": "query\_analyzer",
> "boost": 1
> }
> },
> {
> "multi\_match": {
> "fields": \[
> "title",
> "summary",
> "heading\_text",
> "subheading\_text",
> "body\_text"
> \],
> "query": "TEXT",
> "type": "best\_fields",
> "boost": 0.2,
> "fuzziness": "auto",
> "prefix\_length": 3
> }
> }
> \]
> }
> },
> "from": 0,
> "size": 10,
> "track\_total\_hits": true,
> "timeout": "21s",
> "highlight": {
> "require\_field\_match": true,
> "number\_of\_fragments": 0,
> "fragment\_size": 100,
> "pre\_tags": \[
> "\<highlight\>"
> \],
> "post\_tags": \[
> "\</highlight\>"
> \],
> "fields": {
> "title": {},
> "title.\*": {},
> "summary": {},
> "summary.\*": {},
> "heading\_text": {},
> "heading\_text.\*": {},
> "subheading\_text": {},
> "subheading\_text.\*": {},
> "body\_text": {
> "number\_of\_fragments": 3
> },
> "body\_text.\*": {
> "number\_of\_fragments": 3
> }
> }
> }
> }
> \`\`\`
> 
> \### Logs (if relevant)
> 
> \_No response\_

You can change your index settings to work around that issue for now like this:

```auto
PUT $index_name/_settings
{
    "settings": {
        "index.highlight.weight_matches_mode.enabled": false
    }
}

```

If applying that fix helps then we will likely have a good understanding of what’s causing the regression.

---

<div class="post-metadata">

**Author:** ![colmose](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colmose/32/144973_2.png) [@colmose](https://discuss.elastic.co/u/colmose)\
**Post date:** [September 15, 2025, 9:14am UTC](https://discuss.elastic.co/t/highlighting-on-es8-much-slower-than-es7/375355/4 "2025-09-15T09:14:50Z")

</div>

Thanks for getting back @john-wagster . Appreciate the response.

I tested with your proposed setting with the same query against a replica ES8.18.6 instance where the only change was the index\_setting and it completely removed the regression from ES7 - in terms of time, I didn’t check the actual output.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/5/f5c6a961893cf15f2daa7111771b7e731466676d.png)

Here are the query and mapping that were used (some of the fields were removed for privacy, they were standard “text”/”keyword” fields.)

> **Query**
>
> ```auto
> {
> "track_total_hits": true,
> "_source": false,
> "timeout": "30s",
> "size": 100,
> "query": {
> "bool": {
> "must": [
> {
> "bool": {
> "should": [
> {
> "bool": {
> "must": [
> {
> "range": {
> "pdate": {
> "format": "strict_date_optional_time",
> "gte": "1875-08-18T17:56:00.000Z",
> "lt": "2025-08-18T16:32:00.000Z"
> }
> }
> }
> ]
> }
> }
> ]
> }
> },
> {
> "bool": {
> "should": [
> {
> "simple_query_string": {
> "lenient": true,
> "query": "\"google\"",
> "boost": 10000,
> "fields": [
> "article.author^10",
> "title^10",
> "article.source^10",
> "author^10",
> "companies^10",
> "foundcbref^10",
> "foundnlpref^10",
> "id^10",
> "image^10",
> "siren.nlp.matches.entity/organization^10",
> "siren.nlp.matches.entity/person^10",
> "nlpref^10",
> "siren.nlp.ids.entity/email^10",
> "siren.nlp.ids.entity/financialAccount^10",
> "siren.nlp.ids.entity/hashtag^10",
> "siren.nlp.ids.entity/ipaddress^10",
> "siren.nlp.ids.entity/location^10",
> "siren.nlp.ids.entity/macAddress^10",
> "siren.nlp.ids.entity/organization^10",
> "siren.nlp.ids.entity/person^10",
> "siren.nlp.ids.entity/phonenumber^10",
> "siren.nlp.ids.entity/url^10",
> "siren.nlp.instances.snippet.entity/email.fromfield^10",
> "siren.nlp.instances.snippet.entity/email.id^10",
> "siren.nlp.instances.snippet.entity/email.match^10",
> "siren.nlp.instances.snippet.entity/email.type^10",
> "siren.nlp.instances.snippet.entity/financialAccount.fromfield^10",
> "siren.nlp.instances.snippet.entity/financialAccount.id^10",
> "siren.nlp.instances.snippet.entity/financialAccount.match^10",
> "siren.nlp.instances.snippet.entity/financialAccount.type^10",
> "siren.nlp.instances.snippet.entity/hashtag.fromfield^10",
> "siren.nlp.instances.snippet.entity/hashtag.id^10",
> "siren.nlp.instances.snippet.entity/hashtag.match^10",
> "siren.nlp.instances.snippet.entity/hashtag.type^10",
> "siren.nlp.instances.snippet.entity/ipaddress.fromfield^10",
> "siren.nlp.instances.snippet.entity/ipaddress.id^10",
> "siren.nlp.instances.snippet.entity/ipaddress.match^10",
> "siren.nlp.instances.snippet.entity/ipaddress.type^10",
> "siren.nlp.instances.snippet.entity/location.fromfield^10",
> "siren.nlp.instances.snippet.entity/location.id^10",
> "siren.nlp.instances.snippet.entity/location.match^10",
> "siren.nlp.instances.snippet.entity/location.nerType^10",
> "siren.nlp.instances.snippet.entity/location.type^10",
> "siren.nlp.instances.snippet.entity/macAddress.fromfield^10",
> "siren.nlp.instances.snippet.entity/macAddress.id^10",
> "siren.nlp.instances.snippet.entity/macAddress.match^10",
> "siren.nlp.instances.snippet.entity/macAddress.type^10",
> "siren.nlp.instances.snippet.entity/organization.fromfield^10",
> "siren.nlp.instances.snippet.entity/organization.id^10",
> "siren.nlp.instances.snippet.entity/organization.match^10",
> "siren.nlp.instances.snippet.entity/organization.nerType^10",
> "siren.nlp.instances.snippet.entity/organization.type^10",
> "siren.nlp.instances.snippet.entity/person.fromfield^10",
> "siren.nlp.instances.snippet.entity/person.id^10",
> "siren.nlp.instances.snippet.entity/person.match^10",
> "siren.nlp.instances.snippet.entity/person.nerType^10",
> "siren.nlp.instances.snippet.entity/person.type^10",
> "siren.nlp.instances.snippet.entity/phonenumber.fromfield^10",
> "siren.nlp.instances.snippet.entity/phonenumber.id^10",
> "siren.nlp.instances.snippet.entity/phonenumber.match^10",
> "siren.nlp.instances.snippet.entity/phonenumber.type^10",
> "siren.nlp.instances.snippet.entity/url.fromfield^10",
> "siren.nlp.instances.snippet.entity/url.id^10",
> "siren.nlp.instances.snippet.entity/url.match^10",
> "siren.nlp.instances.snippet.entity/url.type^10",
> "siren.nlp.instances.title.entity/email.fromfield^10",
> "siren.nlp.instances.title.entity/email.id^10",
> "siren.nlp.instances.title.entity/email.match^10",
> "siren.nlp.instances.title.entity/email.type^10",
> "siren.nlp.instances.title.entity/financialAccount.fromfield^10",
> "siren.nlp.instances.title.entity/financialAccount.id^10",
> "siren.nlp.instances.title.entity/financialAccount.match^10",
> "siren.nlp.instances.title.entity/financialAccount.type^10",
> "siren.nlp.instances.title.entity/hashtag.fromfield^10",
> "siren.nlp.instances.title.entity/hashtag.id^10",
> "siren.nlp.instances.title.entity/hashtag.match^10",
> "siren.nlp.instances.title.entity/hashtag.type^10",
> "siren.nlp.instances.title.entity/ipaddress.fromfield^10",
> "siren.nlp.instances.title.entity/ipaddress.id^10",
> "siren.nlp.instances.title.entity/ipaddress.match^10",
> "siren.nlp.instances.title.entity/ipaddress.type^10",
> "siren.nlp.instances.title.entity/location.fromfield^10",
> "siren.nlp.instances.title.entity/location.id^10",
> "siren.nlp.instances.title.entity/location.match^10",
> "siren.nlp.instances.title.entity/location.nerType^10",
> "siren.nlp.instances.title.entity/location.type^10",
> "siren.nlp.instances.title.entity/macAddress.fromfield^10",
> "siren.nlp.instances.title.entity/macAddress.id^10",
> "siren.nlp.instances.title.entity/macAddress.match^10",
> "siren.nlp.instances.title.entity/macAddress.type^10",
> "siren.nlp.instances.title.entity/organization.fromfield^10",
> "siren.nlp.instances.title.entity/organization.id^10",
> "siren.nlp.instances.title.entity/organization.match^10",
> "siren.nlp.instances.title.entity/organization.nerType^10",
> "siren.nlp.instances.title.entity/organization.type^10",
> "siren.nlp.instances.title.entity/person.fromfield^10",
> "siren.nlp.instances.title.entity/person.id^10",
> "siren.nlp.instances.title.entity/person.match^10",
> "siren.nlp.instances.title.entity/person.nerType^10",
> "siren.nlp.instances.title.entity/person.type^10",
> "siren.nlp.instances.title.entity/phonenumber.fromfield^10",
> "siren.nlp.instances.title.entity/phonenumber.id^10",
> "siren.nlp.instances.title.entity/phonenumber.match^10",
> "siren.nlp.instances.title.entity/phonenumber.type^10",
> "siren.nlp.instances.title.entity/url.fromfield^10",
> "siren.nlp.instances.title.entity/url.id^10",
> "siren.nlp.instances.title.entity/url.match^10",
> "siren.nlp.instances.title.entity/url.type^10",
> "siren.nlp.matches.entity/email^10",
> "siren.nlp.matches.entity/financialAccount^10",
> "siren.nlp.matches.entity/hashtag^10",
> "siren.nlp.matches.entity/ipaddress^10",
> "siren.nlp.matches.entity/location^10",
> "siren.nlp.matches.entity/macAddress^10",
> "siren.nlp.matches.entity/phonenumber^10",
> "siren.nlp.matches.entity/url^10",
> "siren.nlp.taxonomy_annotated.snippet^10",
> "siren.nlp.taxonomy_annotated.title^10",
> "snippet^10",
> "source^10",
> "title.raw^10",
> "url^10"
> ]
> }
> },
> {
> "simple_query_string": {
> "lenient": true,
> "query": "(google~2|google*)",
> "default_operator": "AND",
> "fields": [
> "article.author^10",
> "title^10",
> "article.source^10",
> "author^10",
> "companies^10",
> "foundcbref^10",
> "foundnlpref^10",
> "id^10",
> "image^10",
> "siren.nlp.matches.entity/organization^10",
> "siren.nlp.matches.entity/person^10",
> "nlpref^10",
> "siren.nlp.ids.entity/email^10",
> "siren.nlp.ids.entity/financialAccount^10",
> "siren.nlp.ids.entity/hashtag^10",
> "siren.nlp.ids.entity/ipaddress^10",
> "siren.nlp.ids.entity/location^10",
> "siren.nlp.ids.entity/macAddress^10",
> "siren.nlp.ids.entity/organization^10",
> "siren.nlp.ids.entity/person^10",
> "siren.nlp.ids.entity/phonenumber^10",
> "siren.nlp.ids.entity/url^10",
> "siren.nlp.instances.snippet.entity/email.fromfield^10",
> "siren.nlp.instances.snippet.entity/email.id^10",
> "siren.nlp.instances.snippet.entity/email.match^10",
> "siren.nlp.instances.snippet.entity/email.type^10",
> "siren.nlp.instances.snippet.entity/financialAccount.fromfield^10",
> "siren.nlp.instances.snippet.entity/financialAccount.id^10",
> "siren.nlp.instances.snippet.entity/financialAccount.match^10",
> "siren.nlp.instances.snippet.entity/financialAccount.type^10",
> "siren.nlp.instances.snippet.entity/hashtag.fromfield^10",
> "siren.nlp.instances.snippet.entity/hashtag.id^10",
> "siren.nlp.instances.snippet.entity/hashtag.match^10",
> "siren.nlp.instances.snippet.entity/hashtag.type^10",
> "siren.nlp.instances.snippet.entity/ipaddress.fromfield^10",
> "siren.nlp.instances.snippet.entity/ipaddress.id^10",
> "siren.nlp.instances.snippet.entity/ipaddress.match^10",
> "siren.nlp.instances.snippet.entity/ipaddress.type^10",
> "siren.nlp.instances.snippet.entity/location.fromfield^10",
> "siren.nlp.instances.snippet.entity/location.id^10",
> "siren.nlp.instances.snippet.entity/location.match^10",
> "siren.nlp.instances.snippet.entity/location.nerType^10",
> "siren.nlp.instances.snippet.entity/location.type^10",
> "siren.nlp.instances.snippet.entity/macAddress.fromfield^10",
> "siren.nlp.instances.snippet.entity/macAddress.id^10",
> "siren.nlp.instances.snippet.entity/macAddress.match^10",
> "siren.nlp.instances.snippet.entity/macAddress.type^10",
> "siren.nlp.instances.snippet.entity/organization.fromfield^10",
> "siren.nlp.instances.snippet.entity/organization.id^10",
> "siren.nlp.instances.snippet.entity/organization.match^10",
> "siren.nlp.instances.snippet.entity/organization.nerType^10",
> "siren.nlp.instances.snippet.entity/organization.type^10",
> "siren.nlp.instances.snippet.entity/person.fromfield^10",
> "siren.nlp.instances.snippet.entity/person.id^10",
> "siren.nlp.instances.snippet.entity/person.match^10",
> "siren.nlp.instances.snippet.entity/person.nerType^10",
> "siren.nlp.instances.snippet.entity/person.type^10",
> "siren.nlp.instances.snippet.entity/phonenumber.fromfield^10",
> "siren.nlp.instances.snippet.entity/phonenumber.id^10",
> "siren.nlp.instances.snippet.entity/phonenumber.match^10",
> "siren.nlp.instances.snippet.entity/phonenumber.type^10",
> "siren.nlp.instances.snippet.entity/url.fromfield^10",
> "siren.nlp.instances.snippet.entity/url.id^10",
> "siren.nlp.instances.snippet.entity/url.match^10",
> "siren.nlp.instances.snippet.entity/url.type^10",
> "siren.nlp.instances.title.entity/email.fromfield^10",
> "siren.nlp.instances.title.entity/email.id^10",
> "siren.nlp.instances.title.entity/email.match^10",
> "siren.nlp.instances.title.entity/email.type^10",
> "siren.nlp.instances.title.entity/financialAccount.fromfield^10",
> "siren.nlp.instances.title.entity/financialAccount.id^10",
> "siren.nlp.instances.title.entity/financialAccount.match^10",
> "siren.nlp.instances.title.entity/financialAccount.type^10",
> "siren.nlp.instances.title.entity/hashtag.fromfield^10",
> "siren.nlp.instances.title.entity/hashtag.id^10",
> "siren.nlp.instances.title.entity/hashtag.match^10",
> "siren.nlp.instances.title.entity/hashtag.type^10",
> "siren.nlp.instances.title.entity/ipaddress.fromfield^10",
> "siren.nlp.instances.title.entity/ipaddress.id^10",
> "siren.nlp.instances.title.entity/ipaddress.match^10",
> "siren.nlp.instances.title.entity/ipaddress.type^10",
> "siren.nlp.instances.title.entity/location.fromfield^10",
> "siren.nlp.instances.title.entity/location.id^10",
> "siren.nlp.instances.title.entity/location.match^10",
> "siren.nlp.instances.title.entity/location.nerType^10",
> "siren.nlp.instances.title.entity/location.type^10",
> "siren.nlp.instances.title.entity/macAddress.fromfield^10",
> "siren.nlp.instances.title.entity/macAddress.id^10",
> "siren.nlp.instances.title.entity/macAddress.match^10",
> "siren.nlp.instances.title.entity/macAddress.type^10",
> "siren.nlp.instances.title.entity/organization.fromfield^10",
> "siren.nlp.instances.title.entity/organization.id^10",
> "siren.nlp.instances.title.entity/organization.match^10",
> "siren.nlp.instances.title.entity/organization.nerType^10",
> "siren.nlp.instances.title.entity/organization.type^10",
> "siren.nlp.instances.title.entity/person.fromfield^10",
> "siren.nlp.instances.title.entity/person.id^10",
> "siren.nlp.instances.title.entity/person.match^10",
> "siren.nlp.instances.title.entity/person.nerType^10",
> "siren.nlp.instances.title.entity/person.type^10",
> "siren.nlp.instances.title.entity/phonenumber.fromfield^10",
> "siren.nlp.instances.title.entity/phonenumber.id^10",
> "siren.nlp.instances.title.entity/phonenumber.match^10",
> "siren.nlp.instances.title.entity/phonenumber.type^10",
> "siren.nlp.instances.title.entity/url.fromfield^10",
> "siren.nlp.instances.title.entity/url.id^10",
> "siren.nlp.instances.title.entity/url.match^10",
> "siren.nlp.instances.title.entity/url.type^10",
> "siren.nlp.matches.entity/email^10",
> "siren.nlp.matches.entity/financialAccount^10",
> "siren.nlp.matches.entity/hashtag^10",
> "siren.nlp.matches.entity/ipaddress^10",
> "siren.nlp.matches.entity/location^10",
> "siren.nlp.matches.entity/macAddress^10",
> "siren.nlp.matches.entity/phonenumber^10",
> "siren.nlp.matches.entity/url^10",
> "siren.nlp.taxonomy_annotated.snippet^10",
> "siren.nlp.taxonomy_annotated.title^10",
> "snippet^10",
> "source^10",
> "title.raw^10",
> "url^10"
> ]
> }
> }
> ]
> }
> }
> ]
> }
> },
> "highlight": {
> "pre_tags": [
> "@kibana-highlighted-field@"
> ],
> "post_tags": [
> "@/kibana-highlighted-field@"
> ],
> "fields": {
> "*": {
> "type": "unified"
> }
> },
> "fragment_size": 150,
> "number_of_fragments": 2,
> "highlight_query": {
> "bool": {
> "should": [
> {
> "simple_query_string": {
> "lenient": true,
> "query": "\"google\"",
> "boost": 10000,
> "fields": [
> "article.author^10",
> "title^10",
> "article.source^10",
> "author^10",
> "companies^10",
> "foundcbref^10",
> "foundnlpref^10",
> "id^10",
> "image^10",
> "snippet^10",
> "source^10",
> "title.raw^10",
> "url^10"
> ]
> }
> },
> {
> "simple_query_string": {
> "lenient": true,
> "query": "(google~2|google*)",
> "default_operator": "AND",
> "fields": [
> "article.author^10",
> "title^10",
> "article.source^10",
> "author^10",
> "companies^10",
> "foundcbref^10",
> "foundnlpref^10",
> "id^10",
> "image^10",
> "snippet^10",
> "source^10",
> "title.raw^10",
> "url^10"
> ]
> }
> }
> ]
> }
> }
> },
> "aggs": {},
> "stored_fields": [
> "*"
> ],
> "script_fields": {},
> "docvalue_fields": [
> {
> "field": "pdate",
> "format": "date_optional_time"
> },
> {
> "field": "record_date",
> "format": "date_optional_time"
> }
> ]
> }
> 
> ```

> **Mapping**
>
> ```auto
> {
> "company" : {
> "mappings" : {
> "dynamic_templates" : [
> {
> "strings" : {
> "match" : "*",
> "match_mapping_type" : "string",
> "mapping" : {
> "type" : "keyword"
> }
> }
> }
> ],
> "properties" : {
> "blog_feed_url" : {
> "type" : "keyword"
> },
> "blog_url" : {
> "type" : "keyword"
> },
> "category_code" : {
> "type" : "keyword",
> "copy_to" : [
> "company.category_code"
> ]
> },
> "city" : {
> "type" : "keyword"
> },
> "company" : {
> "properties" : {
> "category_code" : {
> "type" : "keyword",
> "store" : true
> },
> "name" : {
> "properties" : {
> "label" : {
> "type" : "text",
> "store" : true,
> "fields" : {
> "raw" : {
> "type" : "keyword",
> "ignore_above" : 768
> }
> }
> }
> }
> },
> "number_of_employees" : {
> "type" : "long",
> "store" : true
> }
> }
> },
> "countrycode" : {
> "type" : "keyword"
> },
> "deadpooled_date" : {
> "type" : "date",
> "format" : "strict_date_optional_time||yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis",
> "ignore_malformed" : true
> },
> "description" : {
> "type" : "text",
> "analyzer" : "custom_analyzer",
> "fielddata" : true
> },
> "email_address" : {
> "type" : "keyword"
> },
> "founded_date" : {
> "type" : "date",
> "format" : "strict_date_optional_time||yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis",
> "ignore_malformed" : true
> },
> "founded_month" : {
> "type" : "long"
> },
> "founded_year" : {
> "type" : "long"
> },
> "freebaseid" : {
> "type" : "keyword"
> },
> "hasstatus" : {
> "type" : "keyword"
> },
> "homepage_url" : {
> "type" : "keyword"
> },
> "id" : {
> "type" : "keyword"
> },
> "label" : {
> "type" : "text",
> "fields" : {
> "raw" : {
> "type" : "keyword",
> "ignore_above" : 768
> }
> },
> "copy_to" : [
> "company.name.label"
> ]
> },
> "label-not-analyzed" : {
> "type" : "keyword"
> },
> "location" : {
> "type" : "geo_point"
> },
> "number_of_employees" : {
> "type" : "long",
> "copy_to" : [
> "company.number_of_employees"
> ]
> },
> "one_competitor" : {
> "type" : "keyword"
> },
> "overview" : {
> "type" : "text",
> "analyzer" : "custom_analyzer",
> "fielddata" : true
> },
> "permalink" : {
> "type" : "keyword"
> },
> "phone_number" : {
> "type" : "keyword"
> },
> "record_date" : {
> "type" : "alias",
> "path" : "founded_date"
> },
> "revenue" : {
> "type" : "keyword"
> },
> "revenuecurrency" : {
> "type" : "keyword"
> },
> "revenuedate" : {
> "type" : "keyword"
> },
> "statecode" : {
> "type" : "keyword"
> },
> "url" : {
> "type" : "keyword"
> },
> "webpage" : {
> "type" : "text"
> }
> }
> }
> }
> }
> 
> ```

Is there any other info I can provide to help dig in this?

---

<div class="post-metadata">

**Author:** ![john-wagster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john-wagster/32/139021_2.png) [@john-wagster](https://discuss.elastic.co/u/john-wagster)\
**Post date:** [September 16, 2025, 3:40am UTC](https://discuss.elastic.co/t/highlighting-on-es8-much-slower-than-es7/375355/5 "2025-09-16T03:40:56Z")

</div>

I’m glad that helped.

I don’t think there’s any other information needed right now. Just have to wait on the fix. Sorry about the regression. I’ll link to this thread on the issue.

Let me know if you have any other problems.

---

<div class="post-metadata">

**Author:** ![Bartosz\_Krakowiak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bartosz_krakowiak/32/141735_2.png) [@Bartosz\_Krakowiak](https://discuss.elastic.co/u/Bartosz_Krakowiak)\
**Post date:** [September 29, 2025, 2:12pm UTC](https://discuss.elastic.co/t/highlighting-on-es8-much-slower-than-es7/375355/6 "2025-09-29T14:12:07Z")

</div>

Thank you @john-wagster, disabling `weight_matches_mode` worked in my case too.
