分类:
2008-12-19 16:39:52
方法1.将 org.apache.nutch.searcher.Summary 第107行 代码 修改为:
public String toString() {
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < fragments.size(); i++) {
buffer.append(fragments.get(i));
}
return "" + buffer.toString()+ "";
}
方法2. Hits hits = bean.search(query, 10);
HitDetails detail=bean.getDetails(hits.getHit(i));
Summary summaries = bean.getSummary(detail, query);
String content=summaries.toHtml(true); //这样得到高亮显示的HTML