pub struct Query {
pub text: String,
pub embedding: Option<Vec<f32>>,
pub filters: Option<Value>,
}Expand description
Query for hybrid search.
Combines text for keyword search and optional embedding for vector search.
Fields§
§text: StringText for keyword search (required).
embedding: Option<Vec<f32>>Pre-computed embedding for vector search (optional).
If None, vector search is skipped or caller must provide.
filters: Option<Value>Optional filters to apply post-retrieval.
Implementations§
Source§impl Query
impl Query
Sourcepub fn text(text: impl Into<String>) -> Self
pub fn text(text: impl Into<String>) -> Self
Create a new query with text only (keyword search).
Sourcepub fn hybrid(text: impl Into<String>, embedding: Vec<f32>) -> Self
pub fn hybrid(text: impl Into<String>, embedding: Vec<f32>) -> Self
Create a query with both text and embedding (hybrid search).
Sourcepub fn with_filters(self, filters: Value) -> Self
pub fn with_filters(self, filters: Value) -> Self
Add filters to the query.
Sourcepub fn has_embedding(&self) -> bool
pub fn has_embedding(&self) -> bool
Check if this query supports vector search.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Query
impl<'de> Deserialize<'de> for Query
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnsafeUnpin for Query
impl UnwindSafe for Query
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