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<F, B>(self, field: F, boost: B) -> Self where
F: ToString,
B: TryInto<Boost>,
pub fn indices_boost<F, B>(self, field: F, boost: B) -> Self where
F: ToString,
B: TryInto<Boost>,
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 from<S>(self, from: S) -> Self where
S: TryInto<u64>,
pub fn from<S>(self, from: S) -> Self where
S: TryInto<u64>,
Starting document offset.
Defaults to 0.
sourcepub fn size<S>(self, size: S) -> Self where
S: TryInto<u64>,
pub fn size<S>(self, size: S) -> Self where
S: TryInto<u64>,
The number of hits to return.
Defaults to 10.
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<S>(self, sort: S) -> Self where
S: Into<Vec<Sort>>,
pub fn sort<S>(self, sort: S) -> Self where
S: Into<Vec<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 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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more