# Highlight query to return all the matched results

**URL:** https://discuss.elastic.co/t/highlight-query-to-return-all-the-matched-results/90803
**Category:** Elasticsearch
**Created:** [June 26, 2017, 9:36am UTC](https://discuss.elastic.co/t/highlight-query-to-return-all-the-matched-results/90803 "2017-06-26T09:36:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jshraddha](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@jshraddha](https://discuss.elastic.co/u/jshraddha)
#### Post date: [June 26, 2017, 9:36am UTC](https://discuss.elastic.co/t/highlight-query-to-return-all-the-matched-results/90803/1 "2017-06-26T09:36:06Z")

</div>

Hi,

Is there any way through which we can specify highlight query to return all the matches?  
I looked for number\_of\_fragments option but here I have to specify some number. I know if I put it to zero it will return me whole document. If I dont specify that option by default it returns me 5 fragments but I want the query which will return all the available fragments that can be more than 5 as well.

---

<div class="post-metadata">

### Author: ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)
#### Post date: [June 26, 2017, 3:31pm UTC](https://discuss.elastic.co/t/highlight-query-to-return-all-the-matched-results/90803/2 "2017-06-26T15:31:55Z")

</div>

I don't think there's a way to say "give me all fragments, whatever that number is", you'll just have to set a very large number so that all available fragments are returned. Kinda kludgy, sorry 😞

---

<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 24, 2017, 3:32pm UTC](https://discuss.elastic.co/t/highlight-query-to-return-all-the-matched-results/90803/3 "2017-07-24T15:32:13Z")

</div>

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