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
Source§impl PartialEq<Query> for ScriptScoreQuery
impl PartialEq<Query> for ScriptScoreQuery
Source§impl PartialEq<ScriptScoreQuery> for Query
impl PartialEq<ScriptScoreQuery> for Query
Source§impl PartialEq for ScriptScoreQuery
impl PartialEq for ScriptScoreQuery
Source§impl Serialize for ScriptScoreQuery
impl Serialize for ScriptScoreQuery
impl StructuralPartialEq for ScriptScoreQuery
Auto Trait Implementations§
impl Freeze for ScriptScoreQuery
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