Struct elasticsearch_dsl::search::queries::joining::HasChildQuery
source · [−]pub struct HasChildQuery { /* private fields */ }
Expand description
Returns parent documents whose joined child documents match a provided query. You can create parent-child relationships between documents in the same index using a join field mapping.
To create has_child query:
Query::has_child("child", Query::term("tag", "elasticsearch"));
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-HasChild-query.html
Implementations
sourceimpl HasChildQuery
impl HasChildQuery
sourcepub fn ignore_unmapped(self, ignore_unmapped: bool) -> Self
pub fn ignore_unmapped(self, ignore_unmapped: bool) -> Self
Indicates whether to ignore an unmapped type
and not return any documents instead of an
error. Defaults to false
.
If false
, Elasticsearch returns an error if the type
is unmapped.
You can use this parameter to query multiple indices that may not contain the type
.
sourcepub fn max_children(self, max_children: impl Into<u32>) -> Self
pub fn max_children(self, max_children: impl Into<u32>) -> Self
Maximum number of child documents that match the query
allowed for a returned parent
document. If the parent document exceeds this limit, it is excluded from the search results.
sourcepub fn min_children(self, min_children: impl Into<u32>) -> Self
pub fn min_children(self, min_children: impl Into<u32>) -> Self
Minimum number of child documents that match the query
required to match the query for a
returned parent document. If the parent document does not meet this limit, it is excluded
from the search results.
sourcepub fn score_mode(self, score_mode: HasChildScoreMode) -> Self
pub fn score_mode(self, score_mode: HasChildScoreMode) -> Self
Indicates how scores for matching child documents affect the root parent document’s relevance score.
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 HasChildQuery
impl Clone for HasChildQuery
sourcefn clone(&self) -> HasChildQuery
fn clone(&self) -> HasChildQuery
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 HasChildQuery
impl Debug for HasChildQuery
sourceimpl PartialEq<HasChildQuery> for HasChildQuery
impl PartialEq<HasChildQuery> for HasChildQuery
sourcefn eq(&self, other: &HasChildQuery) -> bool
fn eq(&self, other: &HasChildQuery) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &HasChildQuery) -> bool
fn ne(&self, other: &HasChildQuery) -> bool
This method tests for !=
.
sourceimpl Serialize for HasChildQuery
impl Serialize for HasChildQuery
impl StructuralPartialEq for HasChildQuery
Auto Trait Implementations
impl RefUnwindSafe for HasChildQuery
impl Send for HasChildQuery
impl Sync for HasChildQuery
impl Unpin for HasChildQuery
impl UnwindSafe for HasChildQuery
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