org.apache.lucene.search.QueryRescorer类的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(75)

本文整理了Java中org.apache.lucene.search.QueryRescorer类的一些代码示例,展示了QueryRescorer类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryRescorer类的具体详情如下:
包路径:org.apache.lucene.search.QueryRescorer
类名称:QueryRescorer

QueryRescorer介绍

[英]A Rescorer that uses a provided Query to assign scores to the first-pass hits.
[中]一种重新排序器,使用提供的查询为第一次通过的点击分配分数。

代码示例

代码示例来源:origin: org.apache.lucene/lucene-core

@Override
public Explanation explain(IndexSearcher searcher, Explanation firstPassExplanation, int docID) throws IOException {
 Explanation secondPassExplanation = searcher.explain(query, docID);
 Float secondPassScore = secondPassExplanation.isMatch() ? secondPassExplanation.getValue() : null;
 float score;
 if (secondPassScore == null) {
  score = combine(firstPassExplanation.getValue(), false, 0.0f);
 } else {
  score = combine(firstPassExplanation.getValue(), true,  secondPassScore.floatValue());
 }
 Explanation first = Explanation.match(firstPassExplanation.getValue(), "first pass score", firstPassExplanation);
 Explanation second;
 if (secondPassScore == null) {
  second = Explanation.noMatch("no second pass score");
 } else {
  second = Explanation.match(secondPassScore, "second pass score", secondPassExplanation);
 }
 return Explanation.match(score, "combined first and second pass score using " + getClass(), first, second);
}

代码示例来源:origin: org.apache.lucene/lucene-core

hit.score = combine(hit.score, true, scorer.score());
} else {
 hit.score = combine(hit.score, false, 0.0f);
hit.score = combine(hit.score, false, 0.0f);

代码示例来源:origin: harbby/presto-connectors

@Override
public Explanation explain(IndexSearcher searcher, Explanation firstPassExplanation, int docID) throws IOException {
 Explanation secondPassExplanation = searcher.explain(query, docID);
 Float secondPassScore = secondPassExplanation.isMatch() ? secondPassExplanation.getValue() : null;
 float score;
 if (secondPassScore == null) {
  score = combine(firstPassExplanation.getValue(), false, 0.0f);
 } else {
  score = combine(firstPassExplanation.getValue(), true,  secondPassScore.floatValue());
 }
 Explanation first = Explanation.match(firstPassExplanation.getValue(), "first pass score", firstPassExplanation);
 Explanation second;
 if (secondPassScore == null) {
  second = Explanation.noMatch("no second pass score");
 } else {
  second = Explanation.match(secondPassScore, "second pass score", secondPassExplanation);
 }
 return Explanation.match(score, "combined first and second pass score using " + getClass(), first, second);
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

@Override
public Explanation explain(IndexSearcher searcher, Explanation firstPassExplanation, int docID) throws IOException {
 Explanation secondPassExplanation = searcher.explain(query, docID);
 Float secondPassScore = secondPassExplanation.isMatch() ? secondPassExplanation.getValue() : null;
 float score;
 if (secondPassScore == null) {
  score = combine(firstPassExplanation.getValue(), false, 0.0f);
 } else {
  score = combine(firstPassExplanation.getValue(), true,  secondPassScore.floatValue());
 }
 Explanation first = Explanation.match(firstPassExplanation.getValue(), "first pass score", firstPassExplanation);
 Explanation second;
 if (secondPassScore == null) {
  second = Explanation.noMatch("no second pass score");
 } else {
  second = Explanation.match(secondPassScore, "second pass score", secondPassExplanation);
 }
 return Explanation.match(score, "combined first and second pass score using " + getClass(), first, second);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

@Override
public Explanation explain(IndexSearcher searcher, Explanation firstPassExplanation, int docID) throws IOException {
 Explanation secondPassExplanation = searcher.explain(query, docID);
 Float secondPassScore = secondPassExplanation.isMatch() ? secondPassExplanation.getValue() : null;
 float score;
 if (secondPassScore == null) {
  score = combine(firstPassExplanation.getValue(), false, 0.0f);
 } else {
  score = combine(firstPassExplanation.getValue(), true,  secondPassScore.floatValue());
 }
 Explanation first = Explanation.match(firstPassExplanation.getValue(), "first pass score", firstPassExplanation);
 Explanation second;
 if (secondPassScore == null) {
  second = Explanation.noMatch("no second pass score");
 } else {
  second = Explanation.match(secondPassScore, "second pass score", secondPassExplanation);
 }
 return Explanation.match(score, "combined first and second pass score using " + getClass(), first, second);
}

代码示例来源:origin: harbby/presto-connectors

hit.score = combine(hit.score, true, scorer.score());
} else {
 hit.score = combine(hit.score, false, 0.0f);
hit.score = combine(hit.score, false, 0.0f);

代码示例来源:origin: org.infinispan/infinispan-embedded-query

hit.score = combine(hit.score, true, scorer.score());
} else {
 hit.score = combine(hit.score, false, 0.0f);
hit.score = combine(hit.score, false, 0.0f);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

hit.score = combine(hit.score, true, scorer.score());
} else {
 hit.score = combine(hit.score, false, 0.0f);
hit.score = combine(hit.score, false, 0.0f);

相关文章

微信公众号

最新文章

更多

QueryRescorer类方法