Java 类org.apache.lucene.search.QueryRescorer 实例源码

项目:search    文件:ReRankQParserPlugin.java   
public Explanation explain(AtomicReaderContext context, int doc) throws IOException {
  Explanation mainExplain = mainWeight.explain(context, doc);
  return new QueryRescorer(reRankQuery) {
    @Override
    protected float combine(float firstPassScore, boolean secondPassMatches, float secondPassScore) {
      float score = firstPassScore;
      if (secondPassMatches) {
        score += reRankWeight * secondPassScore;
      }
      return score;
    }
  }.explain(searcher, mainExplain, context.docBase+doc);
}
项目:community-edition-old    文件:AlfrescoReRankQParserPlugin.java   
public Explanation explain(AtomicReaderContext context, int doc) throws IOException {
    Explanation mainExplain = mainWeight.explain(context, doc);
    return new QueryRescorer(reRankQuery) {
        @Override
        protected float combine(float firstPassScore, boolean secondPassMatches, float secondPassScore) {
            float score = firstPassScore;
            if (secondPassMatches) {
                score += reRankWeight * secondPassScore;
            }
            return score;
        }
    }.explain(searcher, mainExplain, context.docBase+doc);
}
项目:read-open-source-code    文件:ReRankQParserPlugin.java   
public Explanation explain(AtomicReaderContext context, int doc) throws IOException {
  Explanation mainExplain = mainWeight.explain(context, doc);
  return new QueryRescorer(reRankQuery) {
    @Override
    protected float combine(float firstPassScore, boolean secondPassMatches, float secondPassScore) {
      float score = firstPassScore;
      if (secondPassMatches) {
        score += reRankWeight * secondPassScore;
      }
      return score;
    }
  }.explain(searcher, mainExplain, context.docBase+doc);
}