本文整理了Java中org.apache.lucene.search.QueryRescorer
类的一些代码示例,展示了QueryRescorer
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryRescorer
类的具体详情如下:
包路径:org.apache.lucene.search.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);
内容来源于网络,如有侵权,请联系作者删除!