#[repr(i32)]pub enum RecommendStrategy {
AverageVector = 0,
BestScore = 1,
SumScores = 2,
}Expand description
How to use positive and negative vectors to find the results, default is AverageVector.
Variants§
AverageVector = 0
Average positive and negative vectors and create a single query with the formula
query = avg_pos + avg_pos - avg_neg. Then performs normal search.
BestScore = 1
Uses custom search objective. Each candidate is compared against all
examples, its score is then chosen from the max(max_pos_score, max_neg_score).
If the max_neg_score is chosen then it is squared and negated.
SumScores = 2
Uses custom search objective. Compares against all inputs, sums all the scores. Scores against positive vectors are added, against negatives are subtracted.
Implementations§
Source§impl RecommendStrategy
impl RecommendStrategy
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for RecommendStrategy
impl Clone for RecommendStrategy
Source§fn clone(&self) -> RecommendStrategy
fn clone(&self) -> RecommendStrategy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RecommendStrategy
impl Debug for RecommendStrategy
Source§impl Default for RecommendStrategy
impl Default for RecommendStrategy
Source§fn default() -> RecommendStrategy
fn default() -> RecommendStrategy
Source§impl From<RecommendStrategy> for i32
impl From<RecommendStrategy> for i32
Source§fn from(value: RecommendStrategy) -> i32
fn from(value: RecommendStrategy) -> i32
Source§impl Hash for RecommendStrategy
impl Hash for RecommendStrategy
Source§impl Ord for RecommendStrategy
impl Ord for RecommendStrategy
Source§fn cmp(&self, other: &RecommendStrategy) -> Ordering
fn cmp(&self, other: &RecommendStrategy) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for RecommendStrategy
impl PartialEq for RecommendStrategy
Source§impl PartialOrd for RecommendStrategy
impl PartialOrd for RecommendStrategy
Source§impl TryFrom<i32> for RecommendStrategy
impl TryFrom<i32> for RecommendStrategy
Source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
Source§fn try_from(value: i32) -> Result<RecommendStrategy, UnknownEnumValue>
fn try_from(value: i32) -> Result<RecommendStrategy, UnknownEnumValue>
impl Copy for RecommendStrategy
impl Eq for RecommendStrategy
impl StructuralPartialEq for RecommendStrategy
Auto Trait Implementations§
impl Freeze for RecommendStrategy
impl RefUnwindSafe for RecommendStrategy
impl Send for RecommendStrategy
impl Sync for RecommendStrategy
impl Unpin for RecommendStrategy
impl UnwindSafe for RecommendStrategy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request