You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by ma...@yahoo.co.uk on 2004/04/10 14:44:49 UTC
Re: Highlighter package v2 RC1
>>Can I customize the way it does highlight terms? Right now it does so by arounding with <b>.
That's the job of a formatter class. You can pass one in the constructor eg:
Formatter myFormatter=new SimpleHTMLFormatter("<i>","</i>");
Highlighter h=new Highlighter(myFormatter, new QueryScorer(query)));
If you look at the formatter interface you can see it is now passed scores for each token.
You could provide a Formatter implementation which coloured words with different colour intensity
based on these scores if that was a useful effect.
>>Second, I miss the ability to let it highlight all fields or a selection or several fields
Just concatenate them:
String textToBeHighlighted=field1Text+field2Text..;
and then send that to the highlighter, no?
>>What am I going to do if I want the entire text to be highlighted - and not fragmented?
Use one big fragment...
highlighter.setTextFragmenter(new SimpleFragmenter(1000000));
Cheers
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org