# Highlighting multi-valued fields with unlimited fragment size

**URL:** <https://discuss.elastic.co/t/highlighting-multi-valued-fields-with-unlimited-fragment-size/9210>\
**Category:** Elasticsearch\
**Created:** [October 2, 2012, 11:53am UTC](https://discuss.elastic.co/t/highlighting-multi-valued-fields-with-unlimited-fragment-size/9210 "2012-10-02T11:53:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_A\_Brown](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthew_a_brown/32/2699_2.png) [@Matthew\_A\_Brown](https://discuss.elastic.co/u/Matthew_A_Brown)\
**Post date:** [October 2, 2012, 11:53am UTC](https://discuss.elastic.co/t/highlighting-multi-valued-fields-with-unlimited-fragment-size/9210/1 "2012-10-02T11:53:11Z")

</div>

Hi all,

I noticed that at some point in the last few releases, ElasticSearch's  
behavior with highlighting multi-valued fields has gotten much nicer:  
ES now recognizes the boundary between different values in the same  
field, and respects those boundaries when creating fragments. This is  
fantastic.

One problem I'm having, though, is that I'd really like to always get  
the full matching value or values from the multi-valued field in the  
highlight. It seems I can have one or the other, or not both: if I set  
the number\_of\_fragments to 0, I'll get back one full matching value,  
but only one, regardless of how many match. If I don't set the  
number\_of\_frgaments to 0, the fragment is sometimes cut off at the  
beginning (i.e. doesn't start with the first word); playing with the  
fragment\_size and fragment\_offset doesn't seem to help. I'm indexing  
term vectors with\_positions\_offsets term vectors for the fields in  
question.

So, is there any way to get the behavior I'm looking for?

Thanks!  
Mat

--

---

<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 6, 2017, 3:10am UTC](https://discuss.elastic.co/t/highlighting-multi-valued-fields-with-unlimited-fragment-size/9210/2 "2017-07-06T03:10:32Z")

</div>


