# Can we have custom fields index to be included in the Highlights of search?

**URL:** <https://discuss.elastic.co/t/can-we-have-custom-fields-index-to-be-included-in-the-highlights-of-search/31842>\
**Category:** Elasticsearch\
**Created:** [October 8, 2015, 12:01pm UTC](https://discuss.elastic.co/t/can-we-have-custom-fields-index-to-be-included-in-the-highlights-of-search/31842 "2015-10-08T12:01:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hanumanth\_B](https://avatars.discourse-cdn.com/v4/letter/h/f1d935/32.png) [@Hanumanth\_B](https://discuss.elastic.co/u/Hanumanth_B)\
**Post date:** [October 8, 2015, 12:01pm UTC](https://discuss.elastic.co/t/can-we-have-custom-fields-index-to-be-included-in-the-highlights-of-search/31842/1 "2015-10-08T12:01:24Z")

</div>

I need '\_type' field to be included in the response Highlights of search call, currently it has DocumentId and Highlights fields. This I can take from Hits but I want it from Highlights.  
Below is my query

```
{
  "from": 0,
  "size": 40,
  "_source": {
	"include": [],
	"exclude": [
	  "*"
	]
  },
  "sort": [
	{
	  "MAINTITLE.untouched": {
		"order": "desc"
	  }
	},
	{
	  "series_name.untouched": {
		"order": "desc"
	  }
	}
  ],
  "query": {
	"filtered": {
	  "query": {
		"bool": {
		  "must": [
			{
			  "query_string": {
				"query": "pft",
				"fields": [
				  "MAINTITLE.ngramanalyzed",
				  "S_TG_KEYWORDS.ngramanalyzed",
				  "series_name.ngramanalyzed",
				  "teamNameA.ngramanalyzed",
				  "teamNameB.ngramanalyzed"
				],
				"default_operator": "and"
			  }
			}
		  ]
		}
	  },
	  "filter": {
		"bool": {
		  "must": [],
		  "must_not": [],
		  "should": [
			{
			  "bool": {
				"should": [
				  {},
				  {
					"terms": {
					  "channel.untouched": [
						"DEMO-CHANNEL4",
						"DEMO-CHANNEL3",
						"DEMO-CHANNEL2",
						"DEMO-CHANNEL1",
						"NA"
					  ]
					}
				  }
				]
			  }
			}
		  ]
		}
	  }
	}
  },
  "highlight": {
	"pre_tags": [
	  ""
	],
	"post_tags": [
	  ""
	],
	"fields": {
	  "MAINTITLE.ngramanalyzed": {},
	  "S_TG_KEYWORDS.ngramanalyzed": {},
	  "series_name.ngramanalyzed": {},
	  "teamNameA.ngramanalyzed": {},
	  "teamNameB.ngramanalyzed": {}
	}
  }
}

```

In response I am getting DocumentId, Field as "MAINTITLE.ngramanalyzed", and Highlight.  
To this I need to include "\_type" field also. Can anyone please help me 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:** [July 5, 2017, 11:45pm UTC](https://discuss.elastic.co/t/can-we-have-custom-fields-index-to-be-included-in-the-highlights-of-search/31842/2 "2017-07-05T23:45:44Z")

</div>

Closed on July 5, 2017, 11:45pm UTC


