On 10-Apr-08, at 7:41 AM, khirb7 wrote:

I have done deep search and I found that lucene provide this that methode :
getBestFragments
highlighter.getBestFragments(tokenStream, text, maxNumFragment, "...");

so with this methode we can precise to lucene to return maxNumFragment
fragment (with highligted word)of fragsize characters, but there is no
maxFragSize parameter in solr. this would be useful in my case if I want to
highlight not only the first occurrence of a searched word but up to 1
occurrence of the same word in the highlighted text.

I'm not sure I understand exactly what you want the parameter to do.

see http://wiki.apache.org/solr/HighlightingParameters

use:
hl.fragsize=<size> to set the desired fragment size, and
hl.snippets=<number> to set the number of returned snippets/fragments.

-Mike

Reply via email to