Struct rs_es::operations::search::ScanResult
[−]
[src]
pub struct ScanResult { pub took: u64, pub timed_out: bool, pub shards: ShardCountResult, pub hits: SearchHitsResult, pub aggs: Option<AggregationsResult>, // some fields omitted }
Used when scanning and scrolling through results, a ScanResult
is returned
when the scan is opened. To scroll through the results an application has
two options:
Call
scroll
repeatedly until the returned results have zero hits. If this approach is taken, the caller is also responsible for callingclose
when finished, to prevent any server-side resources being held open.Call 'iter' to create an iterator from which the hits can be read. If this approach is taken, there is no need to call
close
, it will be called automatically when iteration ends.
See also the official ElasticSearch documentation for proper use of this functionality.
Fields
took | |
timed_out | |
shards | |
hits | |
aggs |
Methods
impl ScanResult
fn iter(self, client: &mut Client) -> ScanIterator
Returns an iterator from which hits can be read
fn scroll(&mut self, client: &mut Client) -> Result<SearchResult, EsError>
Calls the /_search/scroll
ES end-point for the next page
fn close(&self, client: &mut Client) -> Result<(), EsError>
Calls ES to close the server-side part of the scan/scroll operation