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§
source§impl ScriptScoreQuery
impl ScriptScoreQuery
pub fn serialize<__S>(
__self: &ScriptScoreQuery,
__serializer: __S
) -> Result<__S::Ok, __S::Error>where
__S: Serializer,
source§impl 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§
source§impl Clone for ScriptScoreQuery
impl Clone for ScriptScoreQuery
source§fn clone(&self) -> ScriptScoreQuery
fn clone(&self) -> ScriptScoreQuery
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 ScriptScoreQuery
impl Debug for ScriptScoreQuery
source§impl From<ScriptScoreQuery> for Option<Query>
impl From<ScriptScoreQuery> for Option<Query>
source§fn from(q: ScriptScoreQuery) -> Self
fn from(q: ScriptScoreQuery) -> Self
Converts to this type from the input type.
source§impl From<ScriptScoreQuery> for Query
impl From<ScriptScoreQuery> for Query
source§fn from(q: ScriptScoreQuery) -> Self
fn from(q: ScriptScoreQuery) -> Self
Converts to this type from the input type.
source§impl 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?
source§impl PartialEq<Query> for ScriptScoreQuery
impl PartialEq<Query> for ScriptScoreQuery
source§impl PartialEq<ScriptScoreQuery> for Query
impl PartialEq<ScriptScoreQuery> for Query
source§fn 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 ==
.source§impl PartialEq for ScriptScoreQuery
impl PartialEq for ScriptScoreQuery
source§fn 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 ==
.source§impl 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§
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