Struct tantivy::query::MoreLikeThisQueryBuilder
source · pub struct MoreLikeThisQueryBuilder { /* private fields */ }
Expand description
The builder for more-like-this query
Implementations§
source§impl MoreLikeThisQueryBuilder
impl MoreLikeThisQueryBuilder
sourcepub fn with_min_doc_frequency(self, value: u64) -> Self
pub fn with_min_doc_frequency(self, value: u64) -> Self
Sets the minimum document frequency.
The resulting query will ignore words which do not occur in at least this many docs.
sourcepub fn with_max_doc_frequency(self, value: u64) -> Self
pub fn with_max_doc_frequency(self, value: u64) -> Self
Sets the maximum document frequency.
The resulting query will ignore words which occur in more than this many docs.
sourcepub fn with_min_term_frequency(self, value: usize) -> Self
pub fn with_min_term_frequency(self, value: usize) -> Self
Sets the minimum term frequency.
The resulting query will ignore words less frequent that this number.
sourcepub fn with_max_query_terms(self, value: usize) -> Self
pub fn with_max_query_terms(self, value: usize) -> Self
Sets the maximum query terms.
The resulting query will not return a query with more clause than this.
sourcepub fn with_min_word_length(self, value: usize) -> Self
pub fn with_min_word_length(self, value: usize) -> Self
Sets the minimum word length.
The resulting query will ignore words shorter than this length.
sourcepub fn with_max_word_length(self, value: usize) -> Self
pub fn with_max_word_length(self, value: usize) -> Self
Sets the maximum word length.
The resulting query will ignore words longer than this length.
sourcepub fn with_boost_factor(self, value: f32) -> Self
pub fn with_boost_factor(self, value: f32) -> Self
Sets the boost factor
The boost factor used by the resulting query for boosting terms.
sourcepub fn with_stop_words(self, value: Vec<String>) -> Self
pub fn with_stop_words(self, value: Vec<String>) -> Self
Sets the set of stop words
The resulting query will ignore these set of words.
sourcepub fn with_document(self, doc_address: DocAddress) -> MoreLikeThisQuery
pub fn with_document(self, doc_address: DocAddress) -> MoreLikeThisQuery
Sets the document address
Returns the constructed MoreLikeThisQuery
This document will be used to collect field values, extract frequent terms needed for composing the query.
Note that field values will only be collected from stored fields in the index. You can construct your own field values from any source.
sourcepub fn with_document_fields(
self,
doc_fields: Vec<(Field, Vec<OwnedValue>)>
) -> MoreLikeThisQuery
pub fn with_document_fields( self, doc_fields: Vec<(Field, Vec<OwnedValue>)> ) -> MoreLikeThisQuery
Sets the document fields
Returns the constructed MoreLikeThisQuery
This represents the list field values possibly collected from multiple documents that will be used to compose the resulting query. This interface is meant to be used when you want to provide your own set of fields not necessarily from a specific document.
Trait Implementations§
source§impl Clone for MoreLikeThisQueryBuilder
impl Clone for MoreLikeThisQueryBuilder
source§fn clone(&self) -> MoreLikeThisQueryBuilder
fn clone(&self) -> MoreLikeThisQueryBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MoreLikeThisQueryBuilder
impl Debug for MoreLikeThisQueryBuilder
source§impl Default for MoreLikeThisQueryBuilder
impl Default for MoreLikeThisQueryBuilder
source§fn default() -> MoreLikeThisQueryBuilder
fn default() -> MoreLikeThisQueryBuilder
Auto Trait Implementations§
impl Freeze for MoreLikeThisQueryBuilder
impl RefUnwindSafe for MoreLikeThisQueryBuilder
impl Send for MoreLikeThisQueryBuilder
impl Sync for MoreLikeThisQueryBuilder
impl Unpin for MoreLikeThisQueryBuilder
impl UnwindSafe for MoreLikeThisQueryBuilder
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.