# Highlight in template query elastic

**URL:** <https://discuss.elastic.co/t/highlight-in-template-query-elastic/98982>\
**Category:** Elasticsearch\
**Created:** [August 31, 2017, 9:59am UTC](https://discuss.elastic.co/t/highlight-in-template-query-elastic/98982 "2017-08-31T09:59:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Narmatha](https://avatars.discourse-cdn.com/v4/letter/n/d26b3c/32.png) [@Narmatha](https://discuss.elastic.co/u/Narmatha)\
**Post date:** [August 31, 2017, 9:59am UTC](https://discuss.elastic.co/t/highlight-in-template-query-elastic/98982/1 "2017-08-31T09:59:22Z")

</div>

In the below query i am trying to use the highlight option in the template query but its not working ?

PUT /\_search/template/my\_template  
{  
"template": {  
"bool": {  
"should": [{  
"wildcard": {  
"articleText.textContent": {  
"value": "{{param1}}"  
}  
}  
},  
{  
"wildcard": {  
"articleText.textContent": {  
"value": "{{param2}}"  
}  
}  
},  
{  
"wildcard": {  
"articleText.textContent": {  
"value": "{{param3}}"  
}  
}  
}  
],  
"minimum\_should\_match":1

```
  },

```

"highlight": {  
"fields": {  
"articleText.textContent": {  
"fragment\_size" : 500  
}  
}  
}  
}  
}

How to achieve this ?

---

<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 28, 2017, 9:59am UTC](https://discuss.elastic.co/t/highlight-in-template-query-elastic/98982/2 "2017-09-28T09:59:42Z")

</div>

Closed on September 28, 2017, 9:59am UTC

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