Struct elasticsearch_dsl::search::queries::joining::HasParentQuery
source · pub struct HasParentQuery { /* private fields */ }Expand description
Returns child documents joined to a specific parent document. You can use a join field mapping to create parent-child relationships between documents in the same index.
To create has_parent query:
Query::has_parent("parent", Query::term("tag", "elasticsearch"));https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-HasParent-query.html
Implementations§
source§impl HasParentQuery
impl HasParentQuery
pub fn serialize<__S>(
__self: &HasParentQuery,
__serializer: __S,
) -> Result<__S::Ok, __S::Error>where
__S: Serializer,
source§impl HasParentQuery
impl HasParentQuery
sourcepub fn score(self, score: bool) -> Self
pub fn score(self, score: bool) -> Self
Indicates whether the relevance score of a matching parent document is aggregated into its
child documents. Defaults to false.
If false, Elasticsearch ignores the relevance score of the parent document. Elasticsearch
also assigns each child document a relevance score equal to the query’s boost, which
defaults to 1.
If true, the relevance score of the matching parent document is aggregated into its child
documents’ relevance scores.
sourcepub fn ignore_unmapped(self, ignore_unmapped: bool) -> Self
pub fn ignore_unmapped(self, ignore_unmapped: bool) -> Self
Indicates whether to ignore an unmapped parent_type and not return any documents instead
of an error. Defaults to false.
If false, Elasticsearch returns an error if the parent_type is unmapped.
You can use this parameter to query multiple indices that may not contain the parent_type.
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 HasParentQuery
impl Clone for HasParentQuery
source§fn clone(&self) -> HasParentQuery
fn clone(&self) -> HasParentQuery
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for HasParentQuery
impl Debug for HasParentQuery
source§impl From<HasParentQuery> for Option<Query>
impl From<HasParentQuery> for Option<Query>
source§fn from(q: HasParentQuery) -> Self
fn from(q: HasParentQuery) -> Self
source§impl From<HasParentQuery> for Query
impl From<HasParentQuery> for Query
source§fn from(q: HasParentQuery) -> Self
fn from(q: HasParentQuery) -> Self
source§impl IntoIterator for HasParentQuery
impl IntoIterator for HasParentQuery
§type Item = HasParentQuery
type Item = HasParentQuery
§type IntoIter = IntoIter<<HasParentQuery as IntoIterator>::Item>
type IntoIter = IntoIter<<HasParentQuery as IntoIterator>::Item>
source§impl PartialEq<HasParentQuery> for Query
impl PartialEq<HasParentQuery> for Query
source§impl PartialEq<Query> for HasParentQuery
impl PartialEq<Query> for HasParentQuery
source§impl PartialEq for HasParentQuery
impl PartialEq for HasParentQuery
source§impl Serialize for HasParentQuery
impl Serialize for HasParentQuery
impl StructuralPartialEq for HasParentQuery
Auto Trait Implementations§
impl Freeze for HasParentQuery
impl RefUnwindSafe for HasParentQuery
impl Send for HasParentQuery
impl Sync for HasParentQuery
impl Unpin for HasParentQuery
impl UnwindSafe for HasParentQuery
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)