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<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
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 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for ScriptScoreQuery
impl Debug for ScriptScoreQuery
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 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 IntoIterator for ScriptScoreQuery
impl IntoIterator for ScriptScoreQuery
type Item = ScriptScoreQuery
type Item = ScriptScoreQuery
The type of the elements being iterated over.
type IntoIter = IntoIter<<ScriptScoreQuery as IntoIterator>::Item>
type IntoIter = IntoIter<<ScriptScoreQuery as IntoIterator>::Item>
Which kind of iterator are we turning this into?
sourceimpl PartialEq<ScriptScoreQuery> for Query
impl PartialEq<ScriptScoreQuery> for Query
sourcefn eq(&self, other: &ScriptScoreQuery) -> bool
fn eq(&self, other: &ScriptScoreQuery) -> bool
sourceimpl PartialEq<ScriptScoreQuery> for ScriptScoreQuery
impl PartialEq<ScriptScoreQuery> for ScriptScoreQuery
sourcefn eq(&self, other: &ScriptScoreQuery) -> bool
fn eq(&self, other: &ScriptScoreQuery) -> bool
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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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