Struct rs_es::operations::search::aggregations::Order [] [src]

pub struct Order<'a>(_, _);

Used to define the ordering of buckets in a some bucketted aggregations

Examples

use rs_es::operations::search::aggregations::{Order, OrderKey};

let order1 = Order::asc(OrderKey::Count);
let order2 = Order::desc("field_name");

The first will produce a JSON fragment: {"_count": "asc"}; the second will produce a JSON fragment: {"field_name", "desc"}

Methods

impl<'a> Order<'a>

fn asc<O: Into<OrderKey<'a>>>(key: O) -> Order<'a>

Create an Order ascending

fn desc<O: Into<OrderKey<'a>>>(key: O) -> Order<'a>

Create an Order descending

Trait Implementations

impl<'a> ToJson for Order<'a>

fn to_json(&self) -> Json

Derived Implementations

impl<'a> Debug for Order<'a>

fn fmt(&self, __arg_0: &mut Formatter) -> Result