Struct elasticsearch_dsl::search::request::Search
source · 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§
source§impl Search
impl Search
sourcepub fn runtime_mapping<S>(self, name: S, mapping: RuntimeMapping) -> Selfwhere
S: ToString,
pub fn runtime_mapping<S>(self, name: S, mapping: RuntimeMapping) -> Selfwhere S: ToString,
Add runtime mapping to the search request
sourcepub fn script_fields<S, T>(self, name: S, script: T) -> Selfwhere
S: ToString,
T: Into<ScriptField>,
pub fn script_fields<S, T>(self, name: S, script: T) -> Selfwhere S: ToString, T: Into<ScriptField>,
Add script fields to the search request
sourcepub fn indices_boost<T, U>(self, field: T, boost: U) -> Selfwhere
T: ToString,
U: AsPrimitive<f32>,
pub fn indices_boost<T, U>(self, field: T, boost: U) -> Selfwhere 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) -> Selfwhere
F: Into<f32>,
pub fn min_score<F>(self, min_score: F) -> Selfwhere 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) -> Selfwhere
S: Into<SourceFilter>,
pub fn source<S>(self, source: S) -> Selfwhere S: Into<SourceFilter>,
Indicates which source fields are returned for matching documents
sourcepub fn stats<S>(self, stats: S) -> Selfwhere
S: ToString,
pub fn stats<S>(self, stats: S) -> Selfwhere S: ToString,
Specific tag
of the request for logging and statistical purposes.
sourcepub fn query<Q>(self, query: Q) -> Selfwhere
Q: Into<Query>,
pub fn query<Q>(self, query: Q) -> Selfwhere Q: Into<Query>,
Defines the search definition using the Query DSL.
sourcepub fn post_filter<Q>(self, post_filter: Q) -> Selfwhere
Q: Into<Query>,
pub fn post_filter<Q>(self, post_filter: Q) -> Selfwhere Q: Into<Query>,
When you use the post_filter
parameter to filter search results, the search hits are filtered after the
aggregations are calculated. A post filter has no impact on the aggregation results.
sourcepub fn sort<T>(self, sort: T) -> Selfwhere
T: IntoIterator,
T::Item: Into<Sort>,
pub fn sort<T>(self, sort: T) -> Selfwhere T: IntoIterator, T::Item: Into<Sort>,
A collection of sorting fields
sourcepub fn track_total_hits<T>(self, track_total_hits: T) -> Selfwhere
T: Into<TrackTotalHits>,
pub fn track_total_hits<T>(self, track_total_hits: T) -> Selfwhere T: Into<TrackTotalHits>,
Track total hits
sourcepub fn rescore<T>(self, rescore: T) -> Selfwhere
T: IntoIterator,
T::Item: Into<Rescore>,
pub fn rescore<T>(self, rescore: T) -> Selfwhere T: IntoIterator, T::Item: Into<Rescore>,
Rescore
sourcepub fn suggest<T, U>(self, name: T, suggester: U) -> Selfwhere
T: ToString,
U: Into<Suggester>,
pub fn suggest<T, U>(self, name: T, suggester: U) -> Selfwhere T: ToString, U: Into<Suggester>,
Suggest
sourcepub fn stored_fields<T>(self, stored_fields: T) -> Selfwhere
T: Into<StoredFields>,
pub fn stored_fields<T>(self, stored_fields: T) -> Selfwhere T: Into<StoredFields>,
A collection of stored fields
sourcepub fn docvalue_fields<T>(self, docvalue_fields: T) -> Selfwhere
T: IntoIterator,
T::Item: ToString,
pub fn docvalue_fields<T>(self, docvalue_fields: T) -> Selfwhere T: IntoIterator, T::Item: ToString,
A collection of docvalue fields
sourcepub fn pit(self, pit: PointInTime) -> Self
pub fn pit(self, pit: PointInTime) -> Self
Point in time
sourcepub fn search_after<T>(self, sort_values: T) -> Selfwhere
T: Into<Terms>,
pub fn search_after<T>(self, sort_values: T) -> Selfwhere T: Into<Terms>,
Search after a set of sort values.
sourcepub fn timeout<T>(self, timeout: T) -> Selfwhere
T: Into<Time>,
pub fn timeout<T>(self, timeout: T) -> Selfwhere T: Into<Time>,
parameter to specify a duration you’d like to wait on each shard to complete.
https://www.elastic.co/guide/en/elasticsearch/reference/8.9/search-your-data.html#search-timeout
sourcepub fn aggregate<N, A>(self, aggregation_name: N, aggregation: A) -> Selfwhere
N: Into<AggregationName>,
A: Into<Aggregation>,
pub fn aggregate<N, A>(self, aggregation_name: N, aggregation: A) -> Selfwhere N: Into<AggregationName>, A: Into<Aggregation>,
Pushes aggregation