Struct txtai::similarity::Similarity [−][src]
pub struct Similarity { /* fields omitted */ }
Similarity definition
Implementations
impl Similarity
[src]
impl Similarity
[src]Similarity implementation
pub fn new(url: &str) -> Similarity
[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]
&self,
queries: &Vec<&str>,
texts: &Vec<&str>
) -> IndexResultsBatch
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 RefUnwindSafe for Similarity
impl Send for Similarity
impl Send for Similarity
impl Sync for Similarity
impl Sync for Similarity
impl Unpin for Similarity
impl Unpin for Similarity
impl UnwindSafe for Similarity
impl UnwindSafe for Similarity
Blanket Implementations
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]