# Highlighting on all fields

**URL:** <https://discuss.elastic.co/t/highlighting-on-all-fields/6353>\
**Category:** Elasticsearch\
**Created:** [January 11, 2012, 7:42pm UTC](https://discuss.elastic.co/t/highlighting-on-all-fields/6353 "2012-01-11T19:42:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chimingc](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@chimingc](https://discuss.elastic.co/u/chimingc)\
**Post date:** [January 11, 2012, 7:42pm UTC](https://discuss.elastic.co/t/highlighting-on-all-fields/6353/1 "2012-01-11T19:42:59Z")

</div>

Hi,

I'm new to elastic search and am wondering if there is a way to highlight on all fields.

Looks like highlighting requires me to explicitly specify the field names.  
My understanding is that if I want to highlight on all fields, I will have to use \_all but that requires me to store the \_all field that will increase index size and requires some mappings for \_all.

Is there any way to highlight on all fields without having to store extra data or mapping?

Any sample query will be appreciated.  
Thanks

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [January 11, 2012, 8:39pm UTC](https://discuss.elastic.co/t/highlighting-on-all-fields/6353/2 "2012-01-11T20:39:06Z")

</div>

You need to specify the field to highlight on, or, highlight the \_all field  
([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/all-field.html)).

On Wed, Jan 11, 2012 at 9:42 PM, chimingc [jchen@sugarcrm.com](mailto:jchen@sugarcrm.com) wrote:

> Hi,
> 
> I'm new to Elasticsearch and am wondering if there is a way to highlight  
> on  
> all fields.
> 
> Looks like highlighting requires me to explicitly specify the field names.  
> My understanding is that if I want to highlight on all fields, I will have  
> to use \_all but that requires me to store the \_all field that will increase  
> index size and requires some mappings for \_all.
> 
> Is there any way to highlight on all fields without having to store extra  
> data or mapping?
> 
> Any sample query will be appreciated.  
> Thanks
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Highlighting-on-all-fields-tp3651620p3651620.html](http://elasticsearch-users.115913.n3.nabble.com/Highlighting-on-all-fields-tp3651620p3651620.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![kanishk\_kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kanishk_kumar/32/942_2.png) [@kanishk\_kumar](https://discuss.elastic.co/u/kanishk_kumar)\
**Post date:** [January 30, 2015, 8:57am UTC](https://discuss.elastic.co/t/highlighting-on-all-fields/6353/3 "2015-01-30T08:57:28Z")

</div>

Hi

you can also do like this. it worked like charm for me: use "\*" instead of  
"\_all"

POST 123821/Encounters/\_search  
{  
"query": {  
"query\_string": {  
"query": "Test\*"  
}  
},  
"highlight" : {  
"fields" : {  
"\*" : {}  
}  
}  
}

On Thursday, 12 January 2012 01:12:59 UTC+5:30, Jimmy Chen wrote:

> Hi,
> 
> I'm new to Elasticsearch and am wondering if there is a way to highlight  
> on  
> all fields.
> 
> Looks like highlighting requires me to explicitly specify the field names.  
> My understanding is that if I want to highlight on all fields, I will have  
> to use \_all but that requires me to store the \_all field that will increase  
> index size and requires some mappings for \_all.
> 
> Is there any way to highlight on all fields without having to store extra  
> data or mapping?
> 
> Any sample query will be appreciated.  
> Thanks
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Highlighting-on-all-fields-tp3651620p3651620.html](http://elasticsearch-users.115913.n3.nabble.com/Highlighting-on-all-fields-tp3651620p3651620.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/77d50d6f-1179-48c5-9edd-28c36237d1c6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/77d50d6f-1179-48c5-9edd-28c36237d1c6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:35am UTC](https://discuss.elastic.co/t/highlighting-on-all-fields/6353/4 "2017-07-06T00:35:43Z")

</div>


