Struct txtai::similarity::Similarity [−][src]
pub struct Similarity { /* fields omitted */ }
Expand description
Similarity definition
Implementations
impl Similarity
[src]
impl Similarity
[src]Similarity implementation
pub fn new(url: &str) -> Similarity
[src]
pub fn new(url: &str) -> Similarity
[src]pub async fn similarity(&self, query: &str, texts: &Vec<&str>) -> IndexResults
[src]
pub async fn similarity(&self, query: &str, texts: &Vec<&str>) -> IndexResults
[src]Computes the similarity between query and list of text. Returns a list of {id: value, score: value} sorted by highest score, where id is the index in texts.
Arguments
query
- query texttexts
- list of text
pub async fn batchsimilarity(
&self,
queries: &Vec<&str>,
texts: &Vec<&str>
) -> IndexResultsBatch
[src]
pub async fn batchsimilarity(
&self,
queries: &Vec<&str>,
texts: &Vec<&str>
) -> IndexResultsBatch
[src]Computes the similarity between list of queries and list of text. Returns a list of {id: value, score: value} sorted by highest score per query, where id is the index in texts.
Arguments
queries
- queries texttexts
- list of text
Auto Trait Implementations
impl RefUnwindSafe for Similarity
impl Send for Similarity
impl Sync for Similarity
impl Unpin for Similarity
impl UnwindSafe for Similarity
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]