pub struct Search { /* private fields */ }
Expand description
Returns search hits that match the query defined in the request.
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html
Implementations
sourceimpl Search
impl Search
sourcepub fn runtime_mapping<S>(self, name: S, mapping: RuntimeMapping) -> Self where
S: ToString,
pub fn runtime_mapping<S>(self, name: S, mapping: RuntimeMapping) -> Self where
S: ToString,
Add runtime mapping to the search request
sourcepub fn indices_boost<T, U>(self, field: T, boost: U) -> Self where
T: ToString,
U: AsPrimitive<f32>,
pub fn indices_boost<T, U>(self, field: T, boost: U) -> Self where
T: ToString,
U: AsPrimitive<f32>,
Allows to configure different boost level per index when searching across more than one indices. This is very handy when hits coming from one index matter more than hits coming from another index (think social graph where each user has an index).
sourcepub fn min_score<F>(self, min_score: F) -> Self where
F: Into<f32>,
pub fn min_score<F>(self, min_score: F) -> Self where
F: Into<f32>,
Exclude documents which have a _score
less than the minimum specified
in min_score
Note, most times, this does not make much sense, but is provided for advanced use cases
sourcepub fn source<S>(self, source: S) -> Self where
S: Into<SourceFilter>,
pub fn source<S>(self, source: S) -> Self where
S: Into<SourceFilter>,
Indicates which source fields are returned for matching documents
sourcepub fn stats<S>(self, stats: S) -> Self where
S: ToString,
pub fn stats<S>(self, stats: S) -> Self where
S: ToString,
Specific tag
of the request for logging and statistical purposes.
sourcepub fn query<Q>(self, query: Q) -> Self where
Q: Into<Query>,
pub fn query<Q>(self, query: Q) -> Self where
Q: Into<Query>,
Defines the search definition using the Query DSL.
sourcepub fn sort<T>(self, sort: T) -> Self where
T: IntoIterator,
T::Item: Into<Sort>,
pub fn sort<T>(self, sort: T) -> Self where
T: IntoIterator,
T::Item: Into<Sort>,
A collection of sorting fields
sourcepub fn track_total_hits<T>(self, track_total_hits: T) -> Self where
T: Into<TrackTotalHits>,
pub fn track_total_hits<T>(self, track_total_hits: T) -> Self where
T: Into<TrackTotalHits>,
Track total hits
sourcepub fn rescore<T>(self, rescore: T) -> Self where
T: IntoIterator,
T::Item: Into<Rescore>,
pub fn rescore<T>(self, rescore: T) -> Self where
T: IntoIterator,
T::Item: Into<Rescore>,
Rescore
sourcepub fn suggest<T, U>(self, name: T, suggester: U) -> Self where
T: ToString,
U: Into<Suggester>,
pub fn suggest<T, U>(self, name: T, suggester: U) -> Self where
T: ToString,
U: Into<Suggester>,
Suggest
sourcepub fn aggregate<N, A>(self, aggregation_name: N, aggregation: A) -> Self where
N: Into<AggregationName>,
A: Into<Aggregation>,
pub fn aggregate<N, A>(self, aggregation_name: N, aggregation: A) -> Self where
N: Into<AggregationName>,
A: Into<Aggregation>,
Pushes aggregation
Trait Implementations
impl StructuralPartialEq for Search
Auto Trait Implementations
impl RefUnwindSafe for Search
impl Send for Search
impl Sync for Search
impl Unpin for Search
impl UnwindSafe for Search
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