# Elasticsearch Highlighting: Return all matches

**URL:** https://discuss.elastic.co/t/elasticsearch-highlighting-return-all-matches/193117
**Category:** Elasticsearch
**Created:** [July 31, 2019, 12:40pm UTC](https://discuss.elastic.co/t/elasticsearch-highlighting-return-all-matches/193117 "2019-07-31T12:40:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jriedl](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jriedl](https://discuss.elastic.co/u/jriedl)
#### Post date: [July 31, 2019, 12:40pm UTC](https://discuss.elastic.co/t/elasticsearch-highlighting-return-all-matches/193117/1 "2019-07-31T12:40:37Z")

</div>

We are aiming to provide a fulltext search that returns highlighted snippets. In some contexts it is necessary to obtain all matches within a text document (which is so far saved in a single field). However, increasing the `number_of_fragments` to a large number does not yield the desired results since the number of snippets seems truncated in comparison to the results that are returned when `number_of_fragments = 0` and the entire text is returned highlighted but without passage separation. This behaviour is apparently independent of the Highlighter type (`unified`, `fvh`, `plain`) since all three of them seem to use some kind of hardcoded "bestFragment" approach under the hood. Is there a way (either by parameter settings or by overwriting classes) to achieve this?

---

<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: [August 28, 2019, 12:40pm UTC](https://discuss.elastic.co/t/elasticsearch-highlighting-return-all-matches/193117/2 "2019-08-28T12:40:45Z")

</div>

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