pub struct Query { /* private fields */ }Expand description
A hybrid search request. Build with Query::text, refine with the
builder methods, execute with Grit::search.
§Example
let hits = g.search(
Query::text("exactness").group("algebra").budget(Budget::items(20)),
)?;Implementations§
Source§impl Query
impl Query
Sourcepub fn text(text: impl Into<String>) -> Self
pub fn text(text: impl Into<String>) -> Self
Full-text query over node names/summaries, edge facts, episode content.
Sourcepub fn targets(self, kinds: &[SearchKind]) -> Self
pub fn targets(self, kinds: &[SearchKind]) -> Self
Restrict results to the given kinds. The fused ranking is computed
over ALL kinds (graph expansion still works), then filtered BEFORE
the budget is spent — so targets(&[SearchKind::Edge]) with a
budget of 3 returns the top 3 edges, not whatever edges survive a
mixed top-3 cut.
Sourcepub fn vector(self, embedding: Vec<f32>) -> Self
pub fn vector(self, embedding: Vec<f32>) -> Self
Add a query embedding (computed by the caller — grit never embeds) to enable the vector legs.
Sourcepub fn as_of(self, t: TimestampMs) -> Self
pub fn as_of(self, t: TimestampMs) -> Self
Event-time instant: only return facts true at t.
Sourcepub fn as_at(self, t: TimestampMs) -> Self
pub fn as_at(self, t: TimestampMs) -> Self
System-time instant: only return facts believed at t (time travel).
Trait Implementations§
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