pub struct SearchExpression { /* private fields */ }Expand description
A complete search request.
The engine’s native search input. Index.search() takes this.
JSON parsing at the edge (SearchExpression::from_json) produces this.
The query field accepts any QueryExpression — scoring queries
(match, term, knn, bool) and ranking expressions (fusion/RRF).
Implementations§
Source§impl SearchExpression
impl SearchExpression
Sourcepub fn query(self, query: QueryExpression) -> Self
pub fn query(self, query: QueryExpression) -> Self
Set the query expression (scoring or ranking).
Sourcepub fn scoring_query(self, query: ScoringExpression) -> Self
pub fn scoring_query(self, query: ScoringExpression) -> Self
Set a scoring query (convenience — wraps in QueryExpression::Scoring).
Sourcepub fn agg(self, name: impl Into<String>, agg: AggregationExpression) -> Self
pub fn agg(self, name: impl Into<String>, agg: AggregationExpression) -> Self
Add a named aggregation.
Sourcepub fn search_after(self, cursor: Vec<SortValue>) -> Self
pub fn search_after(self, cursor: Vec<SortValue>) -> Self
Set the search_after cursor.
Sourcepub fn track_total_hits(self, mode: TrackTotalHits) -> Self
pub fn track_total_hits(self, mode: TrackTotalHits) -> Self
Set total hits tracking mode.
Sourcepub fn rescore(self, rescore: RescoreSpec) -> Self
pub fn rescore(self, rescore: RescoreSpec) -> Self
Set a rescore specification.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SearchExpression
impl !UnwindSafe for SearchExpression
impl Freeze for SearchExpression
impl Send for SearchExpression
impl Sync for SearchExpression
impl Unpin for SearchExpression
impl UnsafeUnpin for SearchExpression
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
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>
Converts
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>
Converts
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