# Hightlight not working, need help

**URL:** <https://discuss.elastic.co/t/hightlight-not-working-need-help/69428>\
**Category:** Elasticsearch\
**Created:** [December 19, 2016, 11:17am UTC](https://discuss.elastic.co/t/hightlight-not-working-need-help/69428 "2016-12-19T11:17:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JagjitSingh](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@JagjitSingh](https://discuss.elastic.co/u/JagjitSingh)\
**Post date:** [December 19, 2016, 11:17am UTC](https://discuss.elastic.co/t/hightlight-not-working-need-help/69428/1 "2016-12-19T11:17:48Z")

</div>

> <https://stackoverflow.com/questions/41221236/elasticsearch-highlight-not-working-on-attachments>

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [December 19, 2016, 11:23am UTC](https://discuss.elastic.co/t/hightlight-not-working-need-help/69428/2 "2016-12-19T11:23:50Z")

</div>

As far as I can tell the example code does not include any details of what the `query` parameter might contain.  
The easiest way to progress is to provide the JSON for :

- the document you hope to match
- the index mapping
- the query

---

<div class="post-metadata">

**Author:** ![JagjitSingh](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@JagjitSingh](https://discuss.elastic.co/u/JagjitSingh)\
**Post date:** [December 19, 2016, 11:43am UTC](https://discuss.elastic.co/t/hightlight-not-working-need-help/69428/3 "2016-12-19T11:43:32Z")

</div>

Done, can you please take a look now 🙂

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [December 19, 2016, 11:48am UTC](https://discuss.elastic.co/t/hightlight-not-working-need-help/69428/4 "2016-12-19T11:48:35Z")

</div>

Still missing the JSON for the query. (Sorry - it can be hard to debug/reproduce exactly what's going on when there's various layers of software being used above the raw elasticsearch RESTAPI).

---

<div class="post-metadata">

**Author:** ![JagjitSingh](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@JagjitSingh](https://discuss.elastic.co/u/JagjitSingh)\
**Post date:** [December 19, 2016, 11:59am UTC](https://discuss.elastic.co/t/hightlight-not-working-need-help/69428/5 "2016-12-19T11:59:50Z")

</div>

Updated... Possible to see something now..?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [December 19, 2016, 12:18pm UTC](https://discuss.elastic.co/t/hightlight-not-working-need-help/69428/6 "2016-12-19T12:18:12Z")

</div>

We're still debugging application-tier logic here. Let's try log the query that is being sent by your app.

Assuming you're not in a production environment turn this setting on to log all queries on your elasticsearch index:

```
curl -XPUT "http://localhost:9200/applications/_settings" -d'
{
	"index.search.slowlog.threshold.query.warn": "0s"
}'

```

This will log all searches against your `applications` index in a file called `logs/elasticsearch_index_search_slowlog.log`

Run your search then grab the raw JSON from this file. Once done, use the above command to set the logging threshold back to its default (10 seconds or "10s" I think).

---

<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:** [January 16, 2017, 12:18pm UTC](https://discuss.elastic.co/t/hightlight-not-working-need-help/69428/7 "2017-01-16T12:18:42Z")

</div>

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