Highlighting multi-valued fields with unlimited fragment size

(Matthew A. Brown) #1

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

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

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



(system) #2