Fix explanation of boost queries seeking beyond query result. (#2142)

* Make current nightly Clippy happy.

* Fix explanation of boost queries seeking beyond query result.
This commit is contained in:
Adam Reichold
2023-08-14 04:59:11 +02:00
committed by GitHub
parent b92082b748
commit 22c35b1e00
6 changed files with 25 additions and 21 deletions

View File

@@ -98,7 +98,7 @@ impl<TScoreCombiner: ScoreCombiner> BooleanWeight<TScoreCombiner> {
let sub_scorer: Box<dyn Scorer> = subweight.scorer(reader, boost)?;
per_occur_scorers
.entry(*occur)
.or_insert_with(Vec::new)
.or_default()
.push(sub_scorer);
}
Ok(per_occur_scorers)
@@ -193,7 +193,7 @@ impl<TScoreCombiner: ScoreCombiner + Sync> Weight for BooleanWeight<TScoreCombin
return Ok(Explanation::new("BooleanQuery with no scoring", 1.0));
}
let mut explanation = Explanation::new("BooleanClause. Sum of ...", scorer.score());
let mut explanation = Explanation::new("BooleanClause. sum of ...", scorer.score());
for (occur, subweight) in &self.weights {
if is_positive_occur(*occur) {
if let Ok(child_explanation) = subweight.explain(reader, doc) {