First we need to create a Highlighter instance;
 Highlighter hl = new Highlighter(new SimpleHTMLFormatter("<font color=\"red\" font-size=\"14px\">","</font>"),new QueryScorer(query));
 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["Name"] =  hl.GetBestFragment(sa,"Name",doc.Get("Name")); row["Introduce"] = hl.GetBestFragment(sa,"Introduce",doc.Get("Introduce"));
   row["Introduce"] = hl.GetBestFragment(sa,"Introduce",doc.Get("Introduce"));row this is a table row
 
                    
                     
                    
                 
                    
                 
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号