# Highlight object type field while searching for a word match

**URL:** <https://discuss.elastic.co/t/highlight-object-type-field-while-searching-for-a-word-match/166569>\
**Category:** Elasticsearch\
**Created:** [January 31, 2019, 1:44pm UTC](https://discuss.elastic.co/t/highlight-object-type-field-while-searching-for-a-word-match/166569 "2019-01-31T13:44:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vidhu](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vidhu](https://discuss.elastic.co/u/vidhu)\
**Post date:** [January 31, 2019, 1:44pm UTC](https://discuss.elastic.co/t/highlight-object-type-field-while-searching-for-a-word-match/166569/1 "2019-01-31T13:44:58Z")

</div>

HI All,

I am trying to highlight the object type field, normal fields highlight is working where as for object field, highlights is returning empty array.  
Can anyone please help?  
Doc structure is as below.  
"document": {  
"shareClasses": [  
{  
"szdf": "XXX",  
"sdf": "XXX",  
"documents": [  
{  
"sdf": null,  
"fileName": "XX",  
"documentType": [  
"XX"  
],  
...  
}  
],  
"zxc": "T",  
"zxc": "zxc"  
}  
],  
"documents": [  
{  
"sdc": null,  
"sd": "sd.pdf",  
"sd": [  
"sdf reports"  
],  
...  
}  
],  
"sdf": "csdf",  
"sdf": "vdfvfd",  
"dfv": "sdf",  
"dfssdf": "dfdsfds"  
}

I have built a mustache template and provided the highlights section.  
"highlight": {  
"fields": {  
"documents.documentType": {  
"matched\_fields": ["documents.documentType.autocomplete"],  
"type" : "plain"  
}  
}  
}

---

<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:** [February 28, 2019, 1:45pm UTC](https://discuss.elastic.co/t/highlight-object-type-field-while-searching-for-a-word-match/166569/2 "2019-02-28T13:45:01Z")

</div>

Closed on February 28, 2019, 1:45pm UTC

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