pub struct Search { /* private fields */ }Expand description
Returns search hits that match the query defined in the request.
https://www.elastic.co/guide/en/opensearch/reference/current/search-search.html
Implementations§
Source§impl Search
impl Search
Sourcepub fn runtime_mapping<S>(self, name: S, mapping: RuntimeMapping) -> Searchwhere
S: ToString,
pub fn runtime_mapping<S>(self, name: S, mapping: RuntimeMapping) -> Searchwhere
S: ToString,
Add runtime mapping to the search request
Sourcepub fn script_fields<S, T>(self, name: S, script: T) -> Search
pub fn script_fields<S, T>(self, name: S, script: T) -> Search
Add script fields to the search request
Sourcepub fn indices_boost<T, U>(self, field: T, boost: U) -> Search
pub fn indices_boost<T, U>(self, field: T, boost: U) -> Search
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) -> Search
pub fn min_score<F>(self, min_score: F) -> Search
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) -> Searchwhere
S: Into<SourceFilter>,
pub fn source<S>(self, source: S) -> Searchwhere
S: Into<SourceFilter>,
Indicates which source fields are returned for matching documents
Sourcepub fn stats<S>(self, stats: S) -> Searchwhere
S: ToString,
pub fn stats<S>(self, stats: S) -> Searchwhere
S: ToString,
Specific tag of the request for logging and statistical purposes.
Sourcepub fn post_filter<Q>(self, post_filter: Q) -> Search
pub fn post_filter<Q>(self, post_filter: Q) -> Search
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 track_total_hits<T>(self, track_total_hits: T) -> Searchwhere
T: Into<TrackTotalHits>,
pub fn track_total_hits<T>(self, track_total_hits: T) -> Searchwhere
T: Into<TrackTotalHits>,
Track total hits
Sourcepub fn track_scores(self, enabled: bool) -> Search
pub fn track_scores(self, enabled: bool) -> Search
If true, calculate and return document scores, even if the scores are not used for sorting.
Sourcepub fn stored_fields<T>(self, stored_fields: T) -> Searchwhere
T: Into<StoredFields>,
pub fn stored_fields<T>(self, stored_fields: T) -> Searchwhere
T: Into<StoredFields>,
A collection of stored fields
Sourcepub fn docvalue_fields<T>(self, docvalue_fields: T) -> Search
pub fn docvalue_fields<T>(self, docvalue_fields: T) -> Search
A collection of docvalue fields
Sourcepub fn pit(self, pit: PointInTime) -> Search
pub fn pit(self, pit: PointInTime) -> Search
Point in time
Sourcepub fn search_after<T>(self, sort_values: T) -> Search
pub fn search_after<T>(self, sort_values: T) -> Search
Search after a set of sort values.
Sourcepub fn timeout<T>(self, timeout: T) -> Search
pub fn timeout<T>(self, timeout: T) -> Search
parameter to specify a duration you’d like to wait on each shard to complete.
https://www.elastic.co/guide/en/opensearch/reference/8.9/search-your-data.html#search-timeout
Sourcepub fn knn(self, knn: Knn) -> Search
pub fn knn(self, knn: Knn) -> Search
Defines the kNN query to run.
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html#search-api-knn
Sourcepub fn collapse<C>(self, collapse: C) -> Search
pub fn collapse<C>(self, collapse: C) -> Search
Parameter to specify collapsing results on some field
https://www.elastic.co/guide/en/elasticsearch/reference/current/collapse-search-results.html