pub struct SearchResponse<T> {
pub total: u64,
pub max_score: Option<f32>,
pub hits: Vec<Hit<T>>,
pub took: Duration,
}Expand description
A page of search results.
Fields§
§total: u64Total matches across the whole index, not the page size.
max_score: Option<f32>The top score in this page, if scored.
hits: Vec<Hit<T>>The hits in this page.
took: DurationHow long OpenSearch reported the query took.
Implementations§
Source§impl<T> SearchResponse<T>where
T: DeserializeOwned,
impl<T> SearchResponse<T>where
T: DeserializeOwned,
Sourcepub fn from_value(value: Value) -> Result<Self>
pub fn from_value(value: Value) -> Result<Self>
Decode an OpenSearch _search response body into a typed page.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for SearchResponse<T>
impl<T> RefUnwindSafe for SearchResponse<T>where
T: RefUnwindSafe,
impl<T> Send for SearchResponse<T>where
T: Send,
impl<T> Sync for SearchResponse<T>where
T: Sync,
impl<T> Unpin for SearchResponse<T>where
T: Unpin,
impl<T> UnsafeUnpin for SearchResponse<T>
impl<T> UnwindSafe for SearchResponse<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more