pub struct RelevanceOrder {
pub fields: Vec<String>,
pub query: String,
}Expand description
The full-text operand of an ORDER BY clause (#1284).
Carries the search text as a value, not as SQL: unlike
VectorDistanceOrder, whose literal is built from parsed numbers and is
therefore safe to interpolate, this is arbitrary client input and is bound
as a parameter by the renderer.
§Why the fields are storage keys
The rank has to be computed over the same expression the search predicate
matched on, or the ordering describes a different document from the one that
was searched. build_fts_where_clause emits a WhereClause::Field, whose
path WhereClause::from_graphql_json lowers to the snake_case storage key
and the generator renders as data->>'key' — so these are storage keys and
the renderer extracts them the same way.
Fields§
§fields: Vec<String>The snake_case storage keys of the searchable fields the rank is computed over, in the order the predicate ORs them. Never empty — a rank over no document is refused at render time.
query: StringThe raw websearch_to_tsquery text, exactly as the client sent it.
Trait Implementations§
Source§impl Clone for RelevanceOrder
impl Clone for RelevanceOrder
Source§fn clone(&self) -> RelevanceOrder
fn clone(&self) -> RelevanceOrder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RelevanceOrder
impl Debug for RelevanceOrder
Source§impl<'de> Deserialize<'de> for RelevanceOrder
impl<'de> Deserialize<'de> for RelevanceOrder
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RelevanceOrder, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RelevanceOrder, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for RelevanceOrder
Source§impl PartialEq for RelevanceOrder
impl PartialEq for RelevanceOrder
Source§impl Serialize for RelevanceOrder
impl Serialize for RelevanceOrder
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for RelevanceOrder
Auto Trait Implementations§
impl Freeze for RelevanceOrder
impl RefUnwindSafe for RelevanceOrder
impl Send for RelevanceOrder
impl Sync for RelevanceOrder
impl Unpin for RelevanceOrder
impl UnsafeUnpin for RelevanceOrder
impl UnwindSafe for RelevanceOrder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.