# Issue with queries using highlighting and fields \* - hundreds of times slower

**URL:** https://discuss.elastic.co/t/issue-with-queries-using-highlighting-and-fields-hundreds-of-times-slower/143715
**Category:** Kibana
**Created:** [August 9, 2018, 1:57pm UTC](https://discuss.elastic.co/t/issue-with-queries-using-highlighting-and-fields-hundreds-of-times-slower/143715 "2018-08-09T13:57:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![commentator8](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@commentator8](https://discuss.elastic.co/u/commentator8)
#### Post date: [August 9, 2018, 1:57pm UTC](https://discuss.elastic.co/t/issue-with-queries-using-highlighting-and-fields-hundreds-of-times-slower/143715/1 "2018-08-09T13:57:52Z")

</div>

> [@Kibana 6 - Query/Highlight Performance](https://discuss.elastic.co/t/kibana-6-query-highlight-performance/108038/10):
>
> I think I have experienced this as well. If I call /\_msearch with the same query Kibana uses, it takes 5000ms. If I remove the "highlight":... part of the query, it returns in 100ms or less. I tested on Elasticsearch 6.2.3, auditbeat 6.2.4 (provides the template). Original query: {"index":["infosec-auditbeat\*"],"ignore\_unavailable":true,"preference":1524525012740} {"version":true,"size":500,"sort":[{"@timestamp":{"order":"desc","unmapped\_type":"boolean"}}],"\_source":{"excludes":[]},"aggs":{"2…

I am having the exact same issue on 6.3.2 and only by disabling highlighting can i make queries work properly. My mapping is about 150 lines. Can provide other details as needed.

```
GET /filebeat-6.3.2-box201-box_logs-*/_search
{
"size":1500,"query": {
    "bool": {
      "must": [
        {
          "range": {
            "@timestamp": {
              "gte": 1533821817189,
              "lte": 1533822717189,
              "format": "epoch_millis"
            }
          }
        }
      ],
      "filter": [
        {
          "match_all": {}
        }
      ],
      "should": [],
      "must_not": []
    }
  },
  "highlight":{"pre_tags":["@kibana-highlighted-field@"],"post_tags":["@/kibana-highlighted-field@"],"fragment_size":2147483647,"fields":{"*":{}}}
}

```

without highlight (which was autogenerated in discover) it took 49, with it takes 9711.

What could be the issue?

---

<div class="post-metadata">

### Author: ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)
#### Post date: [August 9, 2018, 4:39pm UTC](https://discuss.elastic.co/t/issue-with-queries-using-highlighting-and-fields-hundreds-of-times-slower/143715/2 "2018-08-09T16:39:16Z")

</div>

How large are your documents? Looks like [highlighting with large documents can be slow](https://discuss.elastic.co/t/query-string-with-highlighting-slow-and-high-cpu-usage/123790/7).

Are you looking for a way to turn highlighting off? You can do this by navigating to `Management` =\> `Advanced Settings` and then unselect `doc_table:highlight`.

---

<div class="post-metadata">

### Author: ![commentator8](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@commentator8](https://discuss.elastic.co/u/commentator8)
#### Post date: [August 9, 2018, 6:31pm UTC](https://discuss.elastic.co/t/issue-with-queries-using-highlighting-and-fields-hundreds-of-times-slower/143715/3 "2018-08-09T18:31:52Z")

</div>

One line logs, small. I have already disabled highlighting as response times are then fine - but i would like to have highlighting enabled.

Seeing the post i included, this seems to be a long time thing right?

---

<div class="post-metadata">

### Author: ![commentator8](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@commentator8](https://discuss.elastic.co/u/commentator8)
#### Post date: [August 19, 2018, 5:44am UTC](https://discuss.elastic.co/t/issue-with-queries-using-highlighting-and-fields-hundreds-of-times-slower/143715/4 "2018-08-19T05:44:45Z")

</div>

I would be happy to supply any and all further details, mappings, settings etc.  
Any ideas out there?

---

<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: [September 16, 2018, 5:44am UTC](https://discuss.elastic.co/t/issue-with-queries-using-highlighting-and-fields-hundreds-of-times-slower/143715/5 "2018-09-16T05:44:47Z")

</div>

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