pub trait Sortable {
// Required methods
fn asc(&self) -> Sort;
fn desc(&self) -> Sort;
}Expand description
A handle that can produce a Sort. The compile-time gate for
SortBuilder::by / tiebreak: implemented for the
orderable leaf handles (Keyword, Text, Number<K>, Date, Bool) and
for a MapKeySort (Type::field().sort_key(..)), but not for a bare
Geo / Object / map handle — so by(geo_handle, …) or by(map_handle, …)
fails to compile (geo sorts go through SortBuilder::near /
raw; a map sorts via its sort_key).
.asc() / .desc() are nesting-aware: a field (or map) inside one or more
nested arrays renders the matching nested chain automatically, from the
scope.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<K, S: FlussoDocument> Sortable for Number<K, S>
impl<S: FlussoDocument> Sortable for Bool<S>
impl<S: FlussoDocument> Sortable for Date<S>
impl<S: FlussoDocument> Sortable for Keyword<S, NoSubfields>
impl<S: FlussoDocument> Sortable for Keyword<S, WithSubfields>
impl<S: FlussoDocument> Sortable for MapKeySort<S>
.asc() / .desc() build the _script sort; a bare value defaults to asc.
impl<S: FlussoDocument> Sortable for Text<S, WithSubfields>
Sorting a text field goes through its case/accent-insensitive
.keyword_lowercase subfield (the analyzed field itself isn’t sortable), so
it’s Sortable only when the field carries auto subfields.