Java 类org.apache.lucene.search.postingshighlight.DefaultPassageFormatter 实例源码

项目:search    文件:PostingsSolrHighlighter.java   
@Override
protected PassageFormatter getFormatter(String fieldName) {
  String preTag = params.getFieldParam(fieldName, HighlightParams.TAG_PRE, "<em>");
  String postTag = params.getFieldParam(fieldName, HighlightParams.TAG_POST, "</em>");
  String ellipsis = params.getFieldParam(fieldName, HighlightParams.TAG_ELLIPSIS, "... ");
  String encoder = params.getFieldParam(fieldName, HighlightParams.ENCODER, "simple");
  return new DefaultPassageFormatter(preTag, postTag, ellipsis, "html".equals(encoder));
}
项目:read-open-source-code    文件:PostingsSolrHighlighter.java   
@Override
protected PassageFormatter getFormatter(String fieldName) {
  String preTag = params.getFieldParam(fieldName, HighlightParams.TAG_PRE, "<em>");
  String postTag = params.getFieldParam(fieldName, HighlightParams.TAG_POST, "</em>");
  String ellipsis = params.getFieldParam(fieldName, HighlightParams.TAG_ELLIPSIS, "... ");
  String encoder = params.getFieldParam(fieldName, HighlightParams.ENCODER, "simple");
  return new DefaultPassageFormatter(preTag, postTag, ellipsis, "html".equals(encoder));
}