Skip to main content

RequestBody

Struct RequestBody 

Source
#[non_exhaustive]
pub struct RequestBody {
Show 18 fields pub allow_partial_search_results: Option<bool>, pub catalog: Option<String>, pub columnar: Option<bool>, pub cursor: Option<String>, pub fetch_size: Option<i32>, pub field_multi_value_leniency: Option<bool>, pub filter: Option<QueryContainer>, pub index_using_frozen: Option<bool>, pub keep_alive: Option<Duration>, pub keep_on_completion: Option<bool>, pub page_timeout: Option<Duration>, pub params: Option<Vec<Value>>, pub query: Option<String>, pub project_routing: Option<ProjectRouting>, pub request_timeout: Option<Duration>, pub runtime_mappings: Option<RuntimeFields>, pub time_zone: Option<TimeZone>, pub wait_for_completion_timeout: Option<Duration>,
}
Expand description

The request’s body.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§allow_partial_search_results: Option<bool>

If true, the response has partial results when there are shard request timeouts or shard failures. If false, the API returns an error with no partial results.

§catalog: Option<String>

The default catalog (cluster) for queries. If unspecified, the queries execute on the data in the local cluster only.

§columnar: Option<bool>

If true, the results are in a columnar fashion: one row represents all the values of a certain column from the current page of results. The API supports this parameter only for CBOR, JSON, SMILE, and YAML responses.

§cursor: Option<String>

The cursor used to retrieve a set of paginated results. If you specify a cursor, the API only uses the columnar and time_zone request body parameters. It ignores other request body parameters.

§fetch_size: Option<i32>

The maximum number of rows (or entries) to return in one response.

§field_multi_value_leniency: Option<bool>

If false, the API returns an exception when encountering multiple values for a field. If true, the API is lenient and returns the first value from the array with no guarantee of consistent results.

§filter: Option<QueryContainer>

The Elasticsearch query DSL for additional filtering.

§index_using_frozen: Option<bool>

If true, the search can run on frozen indices.

§keep_alive: Option<Duration>

The retention period for an async or saved synchronous search.

§keep_on_completion: Option<bool>

If true, Elasticsearch stores synchronous searches if you also specify the wait_for_completion_timeout parameter. If false, Elasticsearch only stores async searches that don’t finish before the wait_for_completion_timeout.

§page_timeout: Option<Duration>

The minimum retention period for the scroll cursor. After this time period, a pagination request might fail because the scroll cursor is no longer available. Subsequent scroll requests prolong the lifetime of the scroll cursor by the duration of page_timeout in the scroll request.

§params: Option<Vec<Value>>

The values for parameters in the query.

§query: Option<String>

The SQL query to run.

§project_routing: Option<ProjectRouting>

Specifies a subset of projects to target using project metadata tags in a subset of Lucene query syntax. Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). Examples: _alias:my-project _alias:_origin _alias:pr Supported in serverless only.

§request_timeout: Option<Duration>

The timeout before the request fails.

§runtime_mappings: Option<RuntimeFields>

One or more runtime fields for the search request. These fields take precedence over mapped fields with the same name.

§time_zone: Option<TimeZone>

The ISO-8601 time zone ID for the search.

§wait_for_completion_timeout: Option<Duration>

The period to wait for complete results. It defaults to no timeout, meaning the request waits for complete search results. If the search doesn’t finish within this period, the search becomes async.

To save a synchronous search, you must specify this parameter and the keep_on_completion parameter.

Implementations§

Source§

impl RequestBody

Source

pub fn new() -> Self

A RequestBody with its required properties set.

Source§

impl RequestBody

Source

pub fn allow_partial_search_results(self, value: bool) -> Self

Sets allow_partial_search_results.

Source

pub fn catalog(self, value: impl Into<String>) -> Self

Sets catalog.

Source

pub fn columnar(self, value: bool) -> Self

Sets columnar.

Source

pub fn cursor(self, value: impl Into<String>) -> Self

Sets cursor.

Source

pub fn fetch_size(self, value: i32) -> Self

Sets fetch_size.

Source

pub fn field_multi_value_leniency(self, value: bool) -> Self

Sets field_multi_value_leniency.

Source

pub fn filter(self, value: impl Into<QueryContainer>) -> Self

Sets filter.

Source

pub fn index_using_frozen(self, value: bool) -> Self

Sets index_using_frozen.

Source

pub fn keep_alive(self, value: impl Into<Duration>) -> Self

Sets keep_alive.

Source

pub fn keep_on_completion(self, value: bool) -> Self

Sets keep_on_completion.

Source

pub fn page_timeout(self, value: impl Into<Duration>) -> Self

Sets page_timeout.

Source

pub fn params(self, value: impl Into<Vec<Value>>) -> Self

Sets params.

Source

pub fn query(self, value: impl Into<String>) -> Self

Sets query.

Source

pub fn project_routing(self, value: impl Into<ProjectRouting>) -> Self

Sets project_routing.

Source

pub fn request_timeout(self, value: impl Into<Duration>) -> Self

Sets request_timeout.

Source

pub fn runtime_mappings(self, value: impl Into<RuntimeFields>) -> Self

Sets runtime_mappings.

Source

pub fn time_zone(self, value: impl Into<TimeZone>) -> Self

Sets time_zone.

Source

pub fn wait_for_completion_timeout(self, value: impl Into<Duration>) -> Self

Sets wait_for_completion_timeout.

Trait Implementations§

Source§

impl Clone for RequestBody

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RequestBody

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for RequestBody

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for RequestBody

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for RequestBody

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for RequestBody

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more