pub struct PinnedQuery { /* private fields */ }
Expand description
The most simple query, which matches all documents, giving them all a
_score
of 1.0
.
To create match_all query:
Query::pinned(PinnedQueryValues::ids([1]), Query::term("user_id", 2))
.boost(2)
.name("matches_everything");
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-all-query.html
Implementations§
Source§impl PinnedQuery
impl PinnedQuery
pub fn serialize<__S>(
__self: &PinnedQuery,
__serializer: __S,
) -> Result<__S::Ok, __S::Error>where
__S: Serializer,
Source§impl PinnedQuery
impl PinnedQuery
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 PinnedQuery
impl Clone for PinnedQuery
Source§fn clone(&self) -> PinnedQuery
fn clone(&self) -> PinnedQuery
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 PinnedQuery
impl Debug for PinnedQuery
Source§impl From<PinnedQuery> for Option<Query>
impl From<PinnedQuery> for Option<Query>
Source§fn from(q: PinnedQuery) -> Self
fn from(q: PinnedQuery) -> Self
Converts to this type from the input type.
Source§impl From<PinnedQuery> for Query
impl From<PinnedQuery> for Query
Source§fn from(q: PinnedQuery) -> Self
fn from(q: PinnedQuery) -> Self
Converts to this type from the input type.
Source§impl IntoIterator for PinnedQuery
impl IntoIterator for PinnedQuery
Source§impl PartialEq<PinnedQuery> for Query
impl PartialEq<PinnedQuery> for Query
Source§impl PartialEq<Query> for PinnedQuery
impl PartialEq<Query> for PinnedQuery
Source§impl PartialEq for PinnedQuery
impl PartialEq for PinnedQuery
Source§impl Serialize for PinnedQuery
impl Serialize for PinnedQuery
impl StructuralPartialEq for PinnedQuery
Auto Trait Implementations§
impl Freeze for PinnedQuery
impl RefUnwindSafe for PinnedQuery
impl Send for PinnedQuery
impl Sync for PinnedQuery
impl Unpin for PinnedQuery
impl UnwindSafe for PinnedQuery
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