Java 类org.apache.lucene.search.highlight.Scorer 实例源码

项目:community-edition-old    文件:AlfrescoSolrHighlighter.java   
/**
 * Return a {@link org.apache.lucene.search.highlight.Scorer} suitable for this Query and field.
 * 
 * @param query
 *            The current query
 * @param fieldName
 *            The name of the field
 * @param request
 *            The SolrQueryRequest
 */
private Scorer getQueryScorer(Query query, String requestFieldname, String schemaFieldName, SolrQueryRequest request)
{
    boolean reqFieldMatch = request.getParams().getFieldBool(requestFieldname, HighlightParams.FIELD_MATCH, false);
    if (reqFieldMatch)
    {
        return new QueryTermScorer(query, request.getSearcher().getIndexReader(), schemaFieldName);
    }
    else
    {
        return new QueryTermScorer(query);
    }
}
项目:lumongo    文件:LumongoHighlighter.java   
public LumongoHighlighter(Formatter formatter, Scorer fragmentScorer, Lumongo.HighlightRequest highlightRequest) {
    super(formatter, fragmentScorer);
    this.highlightRequest = highlightRequest;
}