pub struct Sort<'a> {
pub field: usize,
pub desc: bool,
pub key: &'a dyn Fn(&[u8]) -> Option<Vec<u8>>,
}Expand description
An order to select the top hits by, other than the score.
The key function maps a stored value’s raw bytes to an
order-preserving encoding, computed once per candidate; the segment
then compares bytes and never learns what a number is. None from it
means the document has no usable value for the field, which sorts
last in both directions — missing is not a value, and placing it
at one end or the other by direction would make “the oldest” and “the
newest” disagree about where the unknowns went.
Fields§
§field: usizeWhich declared value field orders the result.
desc: boolDescending when true.
key: &'a dyn Fn(&[u8]) -> Option<Vec<u8>>The order-preserving encoding of one stored value.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Sort<'a>
impl<'a> !Send for Sort<'a>
impl<'a> !Sync for Sort<'a>
impl<'a> !UnwindSafe for Sort<'a>
impl<'a> Freeze for Sort<'a>
impl<'a> Unpin for Sort<'a>
impl<'a> UnsafeUnpin for Sort<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more