diff --git a/src/query/boolean_query/boolean_weight.rs b/src/query/boolean_query/boolean_weight.rs index ac16240fe..a2a407664 100644 --- a/src/query/boolean_query/boolean_weight.rs +++ b/src/query/boolean_query/boolean_weight.rs @@ -67,6 +67,7 @@ fn into_box_scorer( } } +/// Weight associated to the `BoolQuery`. pub struct BooleanWeight { weights: Vec<(Occur, Box)>, scoring_enabled: bool, @@ -74,6 +75,7 @@ pub struct BooleanWeight { } impl BooleanWeight { + /// Creates a new boolean weight. pub fn new( weights: Vec<(Occur, Box)>, scoring_enabled: bool, diff --git a/src/query/boolean_query/mod.rs b/src/query/boolean_query/mod.rs index b5bf519df..a1f3af6ca 100644 --- a/src/query/boolean_query/mod.rs +++ b/src/query/boolean_query/mod.rs @@ -4,7 +4,7 @@ mod boolean_weight; pub(crate) use self::block_wand::{block_wand, block_wand_single_scorer}; pub use self::boolean_query::BooleanQuery; -pub(crate) use self::boolean_weight::BooleanWeight; +pub use self::boolean_weight::BooleanWeight; #[cfg(test)] mod tests { diff --git a/src/query/boost_query.rs b/src/query/boost_query.rs index c12941a67..03cc6855c 100644 --- a/src/query/boost_query.rs +++ b/src/query/boost_query.rs @@ -54,12 +54,14 @@ impl Query for BoostQuery { } } -pub(crate) struct BoostWeight { +/// Weight associated to the BoostQuery. +pub struct BoostWeight { weight: Box, boost: Score, } impl BoostWeight { + /// Creates a new BoostWeight. pub fn new(weight: Box, boost: Score) -> Self { BoostWeight { weight, boost } } diff --git a/src/query/mod.rs b/src/query/mod.rs index 152f703d6..28da5ee56 100644 --- a/src/query/mod.rs +++ b/src/query/mod.rs @@ -35,9 +35,8 @@ pub use self::all_query::{AllQuery, AllScorer, AllWeight}; pub use self::automaton_weight::AutomatonWeight; pub use self::bitset::BitSetDocSet; pub use self::bm25::{Bm25StatisticsProvider, Bm25Weight}; -pub use self::boolean_query::BooleanQuery; -pub(crate) use self::boolean_query::BooleanWeight; -pub use self::boost_query::BoostQuery; +pub use self::boolean_query::{BooleanQuery, BooleanWeight}; +pub use self::boost_query::{BoostQuery, BoostWeight}; pub use self::const_score_query::{ConstScoreQuery, ConstScorer}; pub use self::disjunction_max_query::DisjunctionMaxQuery; pub use self::empty_query::{EmptyQuery, EmptyScorer, EmptyWeight};