Skip to main content

SearchOptions

Struct SearchOptions 

Source
#[non_exhaustive]
pub struct SearchOptions {
Show 24 fields pub collections: Option<Vec<String>>, pub control: Option<Control>, pub explain: Option<bool>, pub facets: Option<HashMap<String, Facet>>, pub fields: Option<Vec<String>>, pub from: Option<u32>, pub highlight: Option<Highlight>, pub include_locations: Option<bool>, pub query: Option<Query>, pub score: Option<String>, pub search_after: Option<Vec<String>>, pub search_before: Option<Vec<String>>, pub show_request: Option<bool>, pub size: Option<u32>, pub sort: Option<Vec<Sort>>, pub knn: Option<Vec<KnnQuery>>, pub knn_operator: Option<KnnOperator>, pub raw: Option<HashMap<String, Value>>, pub index_name: String, pub scope_name: Option<String>, pub bucket_name: Option<String>, pub on_behalf_of: Option<OnBehalfOfInfo>, pub endpoint: Option<String>, pub retry_strategy: Arc<dyn RetryStrategy>,
}

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.
§collections: Option<Vec<String>>§control: Option<Control>§explain: Option<bool>§facets: Option<HashMap<String, Facet>>§fields: Option<Vec<String>>§from: Option<u32>§highlight: Option<Highlight>§include_locations: Option<bool>§query: Option<Query>§score: Option<String>§search_after: Option<Vec<String>>§search_before: Option<Vec<String>>§show_request: Option<bool>§size: Option<u32>§sort: Option<Vec<Sort>>§knn: Option<Vec<KnnQuery>>§knn_operator: Option<KnnOperator>§raw: Option<HashMap<String, Value>>§index_name: String§scope_name: Option<String>§bucket_name: Option<String>§on_behalf_of: Option<OnBehalfOfInfo>§endpoint: Option<String>§retry_strategy: Arc<dyn RetryStrategy>

Implementations§

Source§

impl SearchOptions

Source

pub fn new(index_name: impl Into<String>) -> Self

Source

pub fn collections(self, collections: impl Into<Option<Vec<String>>>) -> Self

Source

pub fn control(self, control: impl Into<Option<Control>>) -> Self

Source

pub fn explain(self, explain: impl Into<Option<bool>>) -> Self

Source

pub fn facets(self, facets: impl Into<Option<HashMap<String, Facet>>>) -> Self

Source

pub fn fields(self, fields: impl Into<Option<Vec<String>>>) -> Self

Source

pub fn from(self, from: impl Into<Option<u32>>) -> Self

Source

pub fn highlight(self, highlight: impl Into<Option<Highlight>>) -> Self

Source

pub fn include_locations( self, include_locations: impl Into<Option<bool>>, ) -> Self

Source

pub fn query(self, query: impl Into<Option<Query>>) -> Self

Source

pub fn score(self, score: impl Into<Option<String>>) -> Self

Source

pub fn search_after(self, search_after: impl Into<Option<Vec<String>>>) -> Self

Source

pub fn search_before( self, search_before: impl Into<Option<Vec<String>>>, ) -> Self

Source

pub fn show_request(self, show_request: impl Into<Option<bool>>) -> Self

Source

pub fn size(self, size: impl Into<Option<u32>>) -> Self

Source

pub fn sort(self, sort: impl Into<Option<Vec<Sort>>>) -> Self

Source

pub fn knn(self, knn: impl Into<Option<Vec<KnnQuery>>>) -> Self

Source

pub fn knn_operator(self, knn_operator: impl Into<Option<KnnOperator>>) -> Self

Source

pub fn raw(self, raw: impl Into<Option<HashMap<String, Value>>>) -> Self

Source

pub fn scope_name(self, scope_name: impl Into<Option<String>>) -> Self

Source

pub fn bucket_name(self, bucket_name: impl Into<Option<String>>) -> Self

Source

pub fn on_behalf_of( self, on_behalf_of: impl Into<Option<OnBehalfOfInfo>>, ) -> Self

Source

pub fn retry_strategy(self, retry_strategy: Arc<dyn RetryStrategy>) -> Self

Source

pub fn endpoint(self, endpoint: impl Into<Option<String>>) -> Self

Trait Implementations§

Source§

impl Clone for SearchOptions

Source§

fn clone(&self) -> SearchOptions

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SearchOptions

Source§

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

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

impl From<SearchOptions> for QueryOptions

Source§

fn from(opts: SearchOptions) -> Self

Converts to this type from the input type.

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> 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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