# Is it possible to relate fields in an index such that highlights are matches across fields?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-relate-fields-in-an-index-such-that-highlights-are-matches-across-fields/286463>\
**Category:** Elasticsearch\
**Created:** [October 12, 2021, 9:53am UTC](https://discuss.elastic.co/t/is-it-possible-to-relate-fields-in-an-index-such-that-highlights-are-matches-across-fields/286463 "2021-10-12T09:53:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![regitze](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/regitze/32/97440_2.png) [@regitze](https://discuss.elastic.co/u/regitze)\
**Post date:** [October 12, 2021, 9:53am UTC](https://discuss.elastic.co/t/is-it-possible-to-relate-fields-in-an-index-such-that-highlights-are-matches-across-fields/286463/1 "2021-10-12T09:53:46Z")

</div>

Hi

I have an index which is constructed in the following way:

```auto
{'id': 'xxx-xxx',
   'text': 'ALICE was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do',
   'start': '0:00:01.94 0:00:02.30 0:00:02.62 0:00:02.96 0:00:03.14 0:00:03.30 0:00:03.42 0:00:03.58 0:00:03.84 0:00:03.92 0:00:04.06 0:00:05.64 0:00:05.94 0:00:06.34 0:00:06.72 0:00:07.90 0:00:08.28 0:00:09.06 0:00:09.20 0:00:09.32 0:00:09.40'
}

```

When searching for 'very tired' I would like to return

- text: 'very tired'
- start: '0:00:03.30 0:00:03.42'

Is there anyway that I can formulate a query that allows me to do this? Or a way to index the data that allows me to return the text that is matched and the corresponding times?

Best,  
Regitze

---

<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:** [November 9, 2021, 9:54am UTC](https://discuss.elastic.co/t/is-it-possible-to-relate-fields-in-an-index-such-that-highlights-are-matches-across-fields/286463/2 "2021-11-09T09:54:35Z")

</div>

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