Crate elastic_responses [] [src]

Elasticsearch Response Iterators

A crate to handle parsing and handling Elasticsearch search results which provides convenient iterators to step through the results returned. It is designed to work with elastic-reqwest.

Usage

Query your Elasticsearch Cluster, then iterate through the results

// Send a request (omitted, see `samples/basic`), and read the response.
// Parse body to JSON as an elastic_responses::Response object
let body_as_json: Response = do_request();

// Use hits() or aggs() iterators
// Hits
for i in body_as_json.hits() {
  println!("{:?}",i);
}

// Agregations
for i in body_as_json.aggs() {
  println!("{:?}",i);
}

Structs

AggregationIterator

Aggregator that traverses the results from Elasticsearch's Aggregations and returns a result row by row in a table-styled fashion.

Aggregations

Type Struct to hold a generic serde_json::Value tree of the Aggregation results.

Hits

Struct to hold the search's Hits, serializable to type T or serde_json::Value

ResponseOf

Main struct of the crate, provides access to the hits and aggs iterators.

Type Definitions

Response