Struct elasticsearch_dsl::search::queries::specialized::ScriptScoreQuery
source · [−]pub struct ScriptScoreQuery { /* private fields */ }
Expand description
A query allowing you to modify the score of documents that are retrieved by a query. This can be useful if, for example, a score function is computationally expensive and it is sufficient to compute the score on a filtered set of documents.
To create script score query:
Query::script_score(
Query::r#match("message", "elasticsearch"),
Script::source("doc['my-int'].value / 10"),
);
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-script-score-query.html
Implementations
sourceimpl ScriptScoreQuery
impl ScriptScoreQuery
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 ScriptScoreQuery
impl Clone for ScriptScoreQuery
sourcefn clone(&self) -> ScriptScoreQuery
fn clone(&self) -> ScriptScoreQuery
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 ScriptScoreQuery
impl Debug for ScriptScoreQuery
sourceimpl From<ScriptScoreQuery> for Query
impl From<ScriptScoreQuery> for Query
sourcefn from(q: ScriptScoreQuery) -> Self
fn from(q: ScriptScoreQuery) -> Self
Converts to this type from the input type.
sourceimpl From<ScriptScoreQuery> for Option<Query>
impl From<ScriptScoreQuery> for Option<Query>
sourcefn from(q: ScriptScoreQuery) -> Self
fn from(q: ScriptScoreQuery) -> Self
Converts to this type from the input type.
sourceimpl From<ScriptScoreQuery> for Queries
impl From<ScriptScoreQuery> for Queries
sourcefn from(q: ScriptScoreQuery) -> Self
fn from(q: ScriptScoreQuery) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<Query> for ScriptScoreQuery
impl PartialEq<Query> for ScriptScoreQuery
sourceimpl PartialEq<ScriptScoreQuery> for ScriptScoreQuery
impl PartialEq<ScriptScoreQuery> for ScriptScoreQuery
sourcefn eq(&self, other: &ScriptScoreQuery) -> bool
fn eq(&self, other: &ScriptScoreQuery) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ScriptScoreQuery) -> bool
fn ne(&self, other: &ScriptScoreQuery) -> bool
This method tests for !=
.
sourceimpl PartialEq<ScriptScoreQuery> for Query
impl PartialEq<ScriptScoreQuery> for Query
sourceimpl Serialize for ScriptScoreQuery
impl Serialize for ScriptScoreQuery
impl StructuralPartialEq for ScriptScoreQuery
Auto Trait Implementations
impl RefUnwindSafe for ScriptScoreQuery
impl Send for ScriptScoreQuery
impl Sync for ScriptScoreQuery
impl Unpin for ScriptScoreQuery
impl UnwindSafe for ScriptScoreQuery
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