# Returning context from other fields in the highlighter

**URL:** <https://discuss.elastic.co/t/returning-context-from-other-fields-in-the-highlighter/72048>\
**Category:** Elasticsearch\
**Created:** [January 18, 2017, 4:12pm UTC](https://discuss.elastic.co/t/returning-context-from-other-fields-in-the-highlighter/72048 "2017-01-18T16:12:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rrva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rrva/32/43888_2.png) [@rrva](https://discuss.elastic.co/u/rrva)\
**Post date:** [January 18, 2017, 4:12pm UTC](https://discuss.elastic.co/t/returning-context-from-other-fields-in-the-highlighter/72048/1 "2017-01-18T16:12:36Z")

</div>

When using the highlighter with match queries, how can I get context from another field on the same nesting level?

Lets say I have a document like

{  
texts: [{ text: "quick brown fox", time: 17 }, ..., { text: "many cunning foxes", time: 213 }]  
}

If I search using match\_phrase and match queries in texts.text and instruct the highlighter to return back texts.text, I only get _highlights around the words in texts.texts. How do I access the corresponding time field for each highlight? Currently I try to search in the raw source on the client, but this is error-prone. Is there a better way?_

---

<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 15, 2017, 4:12pm UTC](https://discuss.elastic.co/t/returning-context-from-other-fields-in-the-highlighter/72048/2 "2017-02-15T16:12:59Z")

</div>

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