探知,不断发现
探知不断发现

First we need to create a Highlighter instance;

 Highlighter hl = new Highlighter(new SimpleHTMLFormatter("<font color=\"red\" font-size=\"14px\">","</font>"),new QueryScorer(query));

Use GetBestFragment method get the result
 row["Name"=  hl.GetBestFragment(sa,"Name",doc.Get("Name"));
   row[
"Introduce"= hl.GetBestFragment(sa,"Introduce",doc.Get("Introduce"));

row this is a table row
posted on 2007-05-21 15:44  lovebanyi  阅读(1480)  评论(1编辑  收藏  举报