lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@tera.gr
Subject Highlighting terms with different style
Date Thu, 10 Jul 2008 09:20:15 GMT
Hi

Is it possible to Hightlight more than one terms with highlighter but  
with different style for each term ??

1st term with SimpleHTMLFormatter("<span class=\"highlight1\">", "</span>");
2rd term with SimpleHTMLFormatter("<span class=\"highlight2\">", "</span>");
......
n-th term  with SimpleHTMLFormatter("<span class=\"highlightn\">", "</span>");

or  for foloween code

  SimpleHTMLFormatter formatter =
                     new SimpleHTMLFormatter("<span  
class=\"highlight\">",  "</span>");
             Highlighter highlighter = new Highlighter(formatter, scorer);

to use something like this:

SimpleHTMLFormatter [] formatters = {new SimpleHTMLFormatter("<span  
class=\"highlight1\">", "</span>"),
                                                               new  
SimpleHTMLFormatter("<span class=\"highlight\">","</span>"),
                                                              ................
                                                              new  
SimpleHTMLFormatter("<span class=\"highlight\">", "</span>") }

Highlighter highlighter = new Highlighter(formatters, scorer);

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message