Struct elasticsearch_dsl::search::queries::compound::ConstantScoreQuery
source · [−]pub struct ConstantScoreQuery { /* private fields */ }
Expand description
Wraps a filter query
and returns every matching document with a
relevance score
equal to the boost
parameter value.
To create constant score query:
Query::constant_score(Query::term("test1", 123))
.boost(3)
.name("test");
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-constant-score-query.html
Implementations
sourceimpl ConstantScoreQuery
impl ConstantScoreQuery
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 ConstantScoreQuery
impl Clone for ConstantScoreQuery
sourcefn clone(&self) -> ConstantScoreQuery
fn clone(&self) -> ConstantScoreQuery
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 ConstantScoreQuery
impl Debug for ConstantScoreQuery
sourceimpl From<ConstantScoreQuery> for Query
impl From<ConstantScoreQuery> for Query
sourcefn from(q: ConstantScoreQuery) -> Self
fn from(q: ConstantScoreQuery) -> Self
Converts to this type from the input type.
sourceimpl From<ConstantScoreQuery> for Option<Query>
impl From<ConstantScoreQuery> for Option<Query>
sourcefn from(q: ConstantScoreQuery) -> Self
fn from(q: ConstantScoreQuery) -> Self
Converts to this type from the input type.
sourceimpl From<ConstantScoreQuery> for Queries
impl From<ConstantScoreQuery> for Queries
sourcefn from(q: ConstantScoreQuery) -> Self
fn from(q: ConstantScoreQuery) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<ConstantScoreQuery> for ConstantScoreQuery
impl PartialEq<ConstantScoreQuery> for ConstantScoreQuery
sourcefn eq(&self, other: &ConstantScoreQuery) -> bool
fn eq(&self, other: &ConstantScoreQuery) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ConstantScoreQuery) -> bool
fn ne(&self, other: &ConstantScoreQuery) -> bool
This method tests for !=
.
sourceimpl PartialEq<ConstantScoreQuery> for Query
impl PartialEq<ConstantScoreQuery> for Query
sourceimpl PartialEq<Query> for ConstantScoreQuery
impl PartialEq<Query> for ConstantScoreQuery
sourceimpl Serialize for ConstantScoreQuery
impl Serialize for ConstantScoreQuery
impl StructuralPartialEq for ConstantScoreQuery
Auto Trait Implementations
impl RefUnwindSafe for ConstantScoreQuery
impl Send for ConstantScoreQuery
impl Sync for ConstantScoreQuery
impl Unpin for ConstantScoreQuery
impl UnwindSafe for ConstantScoreQuery
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