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
sourceimpl BoostingQuery
impl BoostingQuery
sourcepub fn boost<B>(self, boost: B) -> Self where
B: TryInto<Boost>,
pub fn boost<B>(self, boost: B) -> Self where
B: TryInto<Boost>,
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
sourceimpl Clone for BoostingQuery
impl Clone for BoostingQuery
sourcefn clone(&self) -> BoostingQuery
fn clone(&self) -> BoostingQuery
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for BoostingQuery
impl Debug for BoostingQuery
sourceimpl From<BoostingQuery> for Query
impl From<BoostingQuery> for Query
sourcefn from(q: BoostingQuery) -> Self
fn from(q: BoostingQuery) -> Self
Converts to this type from the input type.
sourceimpl From<BoostingQuery> for Option<Query>
impl From<BoostingQuery> for Option<Query>
sourcefn from(q: BoostingQuery) -> Self
fn from(q: BoostingQuery) -> Self
Converts to this type from the input type.
sourceimpl From<BoostingQuery> for Queries
impl From<BoostingQuery> for Queries
sourcefn from(q: BoostingQuery) -> Self
fn from(q: BoostingQuery) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<BoostingQuery> for BoostingQuery
impl PartialEq<BoostingQuery> for BoostingQuery
sourcefn eq(&self, other: &BoostingQuery) -> bool
fn eq(&self, other: &BoostingQuery) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &BoostingQuery) -> bool
fn ne(&self, other: &BoostingQuery) -> bool
This method tests for !=
.
sourceimpl PartialEq<BoostingQuery> for Query
impl PartialEq<BoostingQuery> for Query
sourceimpl PartialEq<Query> for BoostingQuery
impl PartialEq<Query> for BoostingQuery
sourceimpl Serialize for BoostingQuery
impl Serialize for BoostingQuery
impl StructuralPartialEq for BoostingQuery
Auto Trait Implementations
impl RefUnwindSafe for BoostingQuery
impl Send for BoostingQuery
impl Sync for BoostingQuery
impl Unpin for BoostingQuery
impl UnwindSafe for BoostingQuery
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more