pub trait Sortable {
// Required methods
fn asc(&self) -> Sort;
fn desc(&self) -> Sort;
}Expand description
A handle that can produce a field Sort. The compile-time gate for
SortBuilder::by / tiebreak: implemented for the
orderable leaf handles (Keyword, Text, Number<K>, Date, Bool) and
not for Geo / Object / map handles, so by(geo_handle, …) fails to
compile (geo sorts go through SortBuilder::near / raw).
.asc() / .desc() are nesting-aware: a field inside one or more nested
arrays renders the matching nested chain automatically, from the handle’s
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, Sub> Sortable for Keyword<S, Sub>
impl<S: FlussoDocument> Sortable for Bool<S>
impl<S: FlussoDocument> Sortable for Date<S>
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.