pub struct ExistsQuery { /* private fields */ }Expand description
Query that matches all documents with a non-null value in the specified field.
When querying inside a JSON field, “exists” queries can be executed strictly
on the field name or check all the subpaths. In that second case a document
will be matched if a non-null value exists in any subpath. For example,
assuming the following document where myfield is a JSON fast field:
{
"myfield": {
"mysubfield": "hello"
}
}With json_subpaths enabled queries on either myfield or
myfield.mysubfield will match the document. If it is set to false, only
myfield.mysubfield will match it.
All of the matched documents get the score 1.0.
Implementations§
Source§impl ExistsQuery
impl ExistsQuery
Sourcepub fn new_exists_query(field: String) -> ExistsQuery
👎Deprecated
pub fn new_exists_query(field: String) -> ExistsQuery
Creates a new ExistQuery from the given field.
This query matches all documents with at least one non-null value in the specified field. This constructor never fails, but executing the search with this query will return an error if the specified field doesn’t exists or is not a fast field.
Sourcepub fn new(field: String, json_subpaths: bool) -> Self
pub fn new(field: String, json_subpaths: bool) -> Self
Creates a new ExistQuery from the given field.
This query matches all documents with at least one non-null value in the
specified field. If json_subpaths is set to true, documents with
non-null values in any JSON subpath will also be matched.
This constructor never fails, but executing the search with this query will return an error if the specified field doesn’t exists or is not a fast field.
Trait Implementations§
Source§impl Clone for ExistsQuery
impl Clone for ExistsQuery
Source§fn clone(&self) -> ExistsQuery
fn clone(&self) -> ExistsQuery
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExistsQuery
impl Debug for ExistsQuery
Source§impl Query for ExistsQuery
impl Query for ExistsQuery
Source§fn weight(&self, enable_scoring: EnableScoring<'_>) -> Result<Box<dyn Weight>>
fn weight(&self, enable_scoring: EnableScoring<'_>) -> Result<Box<dyn Weight>>
Source§fn explain(
&self,
searcher: &Searcher,
doc_address: DocAddress,
) -> Result<Explanation>
fn explain( &self, searcher: &Searcher, doc_address: DocAddress, ) -> Result<Explanation>
Explanation for the score of the document.Auto Trait Implementations§
impl Freeze for ExistsQuery
impl RefUnwindSafe for ExistsQuery
impl Send for ExistsQuery
impl Sync for ExistsQuery
impl Unpin for ExistsQuery
impl UnsafeUnpin for ExistsQuery
impl UnwindSafe for ExistsQuery
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§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more