mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-06-05 01:50:42 +00:00
Made BooleanWeight and BoostWeight public (#1991)
This commit is contained in:
@@ -67,6 +67,7 @@ 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,
|
||||
@@ -74,6 +75,7 @@ pub struct BooleanWeight<TScoreCombiner: ScoreCombiner> {
|
||||
}
|
||||
|
||||
impl<TScoreCombiner: ScoreCombiner> BooleanWeight<TScoreCombiner> {
|
||||
/// Creates a new boolean weight.
|
||||
pub fn new(
|
||||
weights: Vec<(Occur, Box<dyn Weight>)>,
|
||||
scoring_enabled: bool,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -54,12 +54,14 @@ impl Query for BoostQuery {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) struct BoostWeight {
|
||||
/// 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 }
|
||||
}
|
||||
|
||||
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user