Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: quickwit-oss/tantivy
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 791e794b2b806caeb2f8e19a05a9c9b77cf0f56a
Choose a base ref
..
head repository: quickwit-oss/tantivy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5b83084961573af75bab929b193cd7be2a1179df
Choose a head ref
Showing with 4 additions and 0 deletions.
  1. +2 −0 src/query/boolean_query/boolean_weight.rs
  2. +2 −0 src/query/boost_query.rs
2 changes: 2 additions & 0 deletions src/query/boolean_query/boolean_weight.rs
Original file line number Diff line number Diff line change
@@ -67,13 +67,15 @@ fn into_box_scorer<TScoreCombiner: ScoreCombiner>(
}
}

/// Weight associated to the `BoolQuery`.
pub struct BooleanWeight<TScoreCombiner: ScoreCombiner> {
weights: Vec<(Occur, Box<dyn Weight>)>,
scoring_enabled: bool,
score_combiner_fn: Box<dyn Fn() -> TScoreCombiner + Sync + Send>,
}

impl<TScoreCombiner: ScoreCombiner> BooleanWeight<TScoreCombiner> {
/// Creates a new boolean weight.
pub fn new(
weights: Vec<(Occur, Box<dyn Weight>)>,
scoring_enabled: bool,
2 changes: 2 additions & 0 deletions src/query/boost_query.rs
Original file line number Diff line number Diff line change
@@ -54,12 +54,14 @@ impl Query for BoostQuery {
}
}

/// Weight associated to the BoostQuery.
pub struct BoostWeight {
weight: Box<dyn Weight>,
boost: Score,
}

impl BoostWeight {
/// Creates a new BoostWeight.
pub fn new(weight: Box<dyn Weight>, boost: Score) -> Self {
BoostWeight { weight, boost }
}