I am using a configuration roughly as follows (with solr 4 beta):
<bool name="hl.usePhraseHighlighter">true</bool>
<bool name="hl.highlightMultiTerm">true</bool>
<int name="hl.snippets">4</int>
<bool name="hl.mergeContiguous">true</bool>
The fragment/snippet size is 100 by default. I found a strange case as follows:
The word that I search for appears in a field somewhere between the 300th and
400th characters. Solr, instead of returning a snippet of 100 characters,
returns 400 characters, from the beginning of the text and up to the word that
is highlighted and a bit further on the text. This happens even though in the
first 300 characters there is no hit.
I found out that the length of the snippet (400) is proportional to the number
of snippets (in this case, 100 times 4).
This is a problem because I want to show the user only around 250~ characters.
Is it a bug? Is it configurable?
Thanks,
Yoni