Skip to content

Commit 5b83084

Browse files
committed
Made BooleanWeight and BoostWeight public
1 parent 0ed13ee commit 5b83084

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/query/boolean_query/boolean_weight.rs

+2
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,15 @@ fn into_box_scorer<TScoreCombiner: ScoreCombiner>(
6767
}
6868
}
6969

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

7677
impl<TScoreCombiner: ScoreCombiner> BooleanWeight<TScoreCombiner> {
78+
/// Creates a new boolean weight.
7779
pub fn new(
7880
weights: Vec<(Occur, Box<dyn Weight>)>,
7981
scoring_enabled: bool,

src/query/boolean_query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mod boolean_weight;
44

55
pub(crate) use self::block_wand::{block_wand, block_wand_single_scorer};
66
pub use self::boolean_query::BooleanQuery;
7-
pub(crate) use self::boolean_weight::BooleanWeight;
7+
pub use self::boolean_weight::BooleanWeight;
88

99
#[cfg(test)]
1010
mod tests {

src/query/boost_query.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ impl Query for BoostQuery {
5454
}
5555
}
5656

57-
pub(crate) struct BoostWeight {
57+
/// Weight associated to the BoostQuery.
58+
pub struct BoostWeight {
5859
weight: Box<dyn Weight>,
5960
boost: Score,
6061
}
6162

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

src/query/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ pub use self::all_query::{AllQuery, AllScorer, AllWeight};
3535
pub use self::automaton_weight::AutomatonWeight;
3636
pub use self::bitset::BitSetDocSet;
3737
pub use self::bm25::{Bm25StatisticsProvider, Bm25Weight};
38-
pub use self::boolean_query::BooleanQuery;
39-
pub(crate) use self::boolean_query::BooleanWeight;
40-
pub use self::boost_query::BoostQuery;
38+
pub use self::boolean_query::{BooleanQuery, BooleanWeight};
39+
pub use self::boost_query::{BoostQuery, BoostWeight};
4140
pub use self::const_score_query::{ConstScoreQuery, ConstScorer};
4241
pub use self::disjunction_max_query::DisjunctionMaxQuery;
4342
pub use self::empty_query::{EmptyQuery, EmptyScorer, EmptyWeight};

0 commit comments

Comments
 (0)