diff --git a/src/docset.rs b/src/docset.rs index 24282f4a8..3c5dfdd31 100644 --- a/src/docset.rs +++ b/src/docset.rs @@ -10,7 +10,7 @@ use std::borrow::BorrowMut; pub const TERMINATED: DocId = std::i32::MAX as u32; /// Represents an iterable set of sorted doc ids. -pub trait DocSet { +pub trait DocSet: Send { /// Goes to the next element. /// /// The DocId of the next element is returned. diff --git a/src/query/reqopt_scorer.rs b/src/query/reqopt_scorer.rs index a9f26aa24..a3d39a928 100644 --- a/src/query/reqopt_scorer.rs +++ b/src/query/reqopt_scorer.rs @@ -12,7 +12,7 @@ use std::marker::PhantomData; /// This is useful for queries like `+somethingrequired somethingoptional`. /// /// Note that `somethingoptional` has no impact on the `DocSet`. -pub struct RequiredOptionalScorer { +pub struct RequiredOptionalScorer { req_scorer: TReqScorer, opt_scorer: TOptScorer, score_cache: Option, @@ -23,6 +23,7 @@ impl RequiredOptionalScorer where TOptScorer: DocSet, + TScoreCombiner: ScoreCombiner, { /// Creates a new `RequiredOptionalScorer`. pub fn new( @@ -43,6 +44,7 @@ impl DocSet where TReqScorer: DocSet, TOptScorer: DocSet, + TScoreCombiner: ScoreCombiner, { fn advance(&mut self) -> DocId { self.score_cache = None; diff --git a/src/query/score_combiner.rs b/src/query/score_combiner.rs index 34be8a9e9..7af0e876a 100644 --- a/src/query/score_combiner.rs +++ b/src/query/score_combiner.rs @@ -3,7 +3,7 @@ use crate::Score; /// The `ScoreCombiner` trait defines how to compute /// an overall score given a list of scores. -pub trait ScoreCombiner: Default + Clone + Copy + 'static { +pub trait ScoreCombiner: Default + Clone + Send + Copy + 'static { /// Aggregates the score combiner with the given scorer. /// /// The `ScoreCombiner` may decide to call `.scorer.score()`