# Highlighting \_all fields

**URL:** <https://discuss.elastic.co/t/highlighting--all-fields/44777>\
**Category:** Elasticsearch\
**Created:** [March 17, 2016, 11:03pm UTC](https://discuss.elastic.co/t/highlighting--all-fields/44777 "2016-03-17T23:03:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arvind\_Kumar\_Chigura](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@Arvind\_Kumar\_Chigura](https://discuss.elastic.co/u/Arvind_Kumar_Chigura)\
**Post date:** [March 17, 2016, 11:03pm UTC](https://discuss.elastic.co/t/highlighting--all-fields/44777/1 "2016-03-17T23:03:06Z")

</div>

I enabled store=true for my all fields. then I tried to highlight and I get below error. Please help

"can't load global ordinals for reader of type: class org.apache.lucene.search.highlight.WeightedSpanTermExtractor$DelegatingLeafReader must be a DirectoryReader"

---

<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:** [March 18, 2016, 5:34pm UTC](https://discuss.elastic.co/t/highlighting--all-fields/44777/2 "2016-03-18T17:34:38Z")

</div>

I'm not sure what that error is but generally highlighting the \_all field is not desirable.

The default for the highlighter is to highlight fields using only terms from the query that were explicitly targeted at those fields (so a search for forename:mark won't highlight any "mark" tokens found in a surname field).

However, when searching the all field this is precisely what you want to do - search one (indexed) field but highlight another (stored) field. Try set require\_field\_match to false.  
See [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html#field-match3](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html#field-match3)

---

<div class="post-metadata">

**Author:** ![Arvind\_Kumar\_Chigura](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@Arvind\_Kumar\_Chigura](https://discuss.elastic.co/u/Arvind_Kumar_Chigura)\
**Post date:** [March 18, 2016, 9:59pm UTC](https://discuss.elastic.co/t/highlighting--all-fields/44777/3 "2016-03-18T21:59:12Z")

</div>

I am searching for a phrase with in a whole document, so any field can be a match.

I need the highlighter to give me highlights for all fields where the match was.

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [March 18, 2016, 10:21pm UTC](https://discuss.elastic.co/t/highlighting--all-fields/44777/4 "2016-03-18T22:21:01Z")

</div>

In that case you can try to highlight on "\*" and set require\_field\_match to false.

---

<div class="post-metadata">

**Author:** ![Arvind\_Kumar\_Chigura](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@Arvind\_Kumar\_Chigura](https://discuss.elastic.co/u/Arvind_Kumar_Chigura)\
**Post date:** [March 18, 2016, 10:33pm UTC](https://discuss.elastic.co/t/highlighting--all-fields/44777/5 "2016-03-18T22:33:13Z")

</div>

When I try to highlight on \*, I get ( i have set \_all store=yes)

"can't load global ordinals for reader of type: class org.apache.lucene.search.highlight.WeightedSpanTermExtractor$DelegatingLeafReader must be a DirectoryReader"

---

<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:06pm UTC](https://discuss.elastic.co/t/highlighting--all-fields/44777/6 "2017-07-05T23:06:58Z")

</div>


