Struct elasticsearch_dsl::search::queries::compound::BoostingQuery
source · pub struct BoostingQuery { /* private fields */ }Expand description
Returns documents matching a positive query while reducing the
relevance score
of documents that also match a negative query.
You can use the boosting query to demote certain documents without excluding them from the search results.
To create boosting query:
Query::boosting(Query::term("test1", 123), Query::term("test2", 456), 0.2)
.boost(3)
.name("test");https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-boosting-query.html
Implementations§
source§impl BoostingQuery
impl BoostingQuery
pub fn serialize<__S>(
__self: &BoostingQuery,
__serializer: __S,
) -> Result<__S::Ok, __S::Error>where
__S: Serializer,
source§impl BoostingQuery
impl BoostingQuery
sourcepub fn boost<T>(self, boost: T) -> Selfwhere
T: AsPrimitive<f32>,
pub fn boost<T>(self, boost: T) -> Selfwhere
T: AsPrimitive<f32>,
Floating point number used to decrease or increase the
relevance scores
of a query. Defaults to 1.0.
You can use the boost parameter to adjust relevance scores for searches containing two or more queries.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
Trait Implementations§
source§impl Clone for BoostingQuery
impl Clone for BoostingQuery
source§fn clone(&self) -> BoostingQuery
fn clone(&self) -> BoostingQuery
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for BoostingQuery
impl Debug for BoostingQuery
source§impl From<BoostingQuery> for Option<Query>
impl From<BoostingQuery> for Option<Query>
source§fn from(q: BoostingQuery) -> Self
fn from(q: BoostingQuery) -> Self
Converts to this type from the input type.
source§impl From<BoostingQuery> for Query
impl From<BoostingQuery> for Query
source§fn from(q: BoostingQuery) -> Self
fn from(q: BoostingQuery) -> Self
Converts to this type from the input type.
source§impl IntoIterator for BoostingQuery
impl IntoIterator for BoostingQuery
§type Item = BoostingQuery
type Item = BoostingQuery
The type of the elements being iterated over.
§type IntoIter = IntoIter<<BoostingQuery as IntoIterator>::Item>
type IntoIter = IntoIter<<BoostingQuery as IntoIterator>::Item>
Which kind of iterator are we turning this into?
source§impl PartialEq<BoostingQuery> for Query
impl PartialEq<BoostingQuery> for Query
source§impl PartialEq<Query> for BoostingQuery
impl PartialEq<Query> for BoostingQuery
source§impl PartialEq for BoostingQuery
impl PartialEq for BoostingQuery
source§impl Serialize for BoostingQuery
impl Serialize for BoostingQuery
impl StructuralPartialEq for BoostingQuery
Auto Trait Implementations§
impl Freeze for BoostingQuery
impl RefUnwindSafe for BoostingQuery
impl Send for BoostingQuery
impl Sync for BoostingQuery
impl Unpin for BoostingQuery
impl UnwindSafe for BoostingQuery
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)