Struct elasticsearch_dsl::search::queries::specialized::ScriptQuery
source · [−]pub struct ScriptQuery { /* private fields */ }
Expand description
Filters documents based on a provided script. The script query is typically used in a filter context.
To create script query:
Query::script(Script::source("return doc['amount'].value < 10;"));
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-script-query.html
Implementations
sourceimpl ScriptQuery
impl ScriptQuery
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 ScriptQuery
impl Clone for ScriptQuery
sourcefn clone(&self) -> ScriptQuery
fn clone(&self) -> ScriptQuery
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 ScriptQuery
impl Debug for ScriptQuery
sourceimpl From<ScriptQuery> for Query
impl From<ScriptQuery> for Query
sourcefn from(q: ScriptQuery) -> Self
fn from(q: ScriptQuery) -> Self
Converts to this type from the input type.
sourceimpl From<ScriptQuery> for Option<Query>
impl From<ScriptQuery> for Option<Query>
sourcefn from(q: ScriptQuery) -> Self
fn from(q: ScriptQuery) -> Self
Converts to this type from the input type.
sourceimpl From<ScriptQuery> for Queries
impl From<ScriptQuery> for Queries
sourcefn from(q: ScriptQuery) -> Self
fn from(q: ScriptQuery) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<Query> for ScriptQuery
impl PartialEq<Query> for ScriptQuery
sourceimpl PartialEq<ScriptQuery> for ScriptQuery
impl PartialEq<ScriptQuery> for ScriptQuery
sourcefn eq(&self, other: &ScriptQuery) -> bool
fn eq(&self, other: &ScriptQuery) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ScriptQuery) -> bool
fn ne(&self, other: &ScriptQuery) -> bool
This method tests for !=
.
sourceimpl PartialEq<ScriptQuery> for Query
impl PartialEq<ScriptQuery> for Query
sourceimpl Serialize for ScriptQuery
impl Serialize for ScriptQuery
impl StructuralPartialEq for ScriptQuery
Auto Trait Implementations
impl RefUnwindSafe for ScriptQuery
impl Send for ScriptQuery
impl Sync for ScriptQuery
impl Unpin for ScriptQuery
impl UnwindSafe for ScriptQuery
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