pub struct InterestTracker;Expand description
Tracks user queries to surface topics the user is interested in.
Implementations§
Source§impl InterestTracker
impl InterestTracker
pub fn new() -> Self
Sourcepub fn record_query(
&self,
conn: &Connection,
query: &str,
workspace: &str,
) -> Result<()>
pub fn record_query( &self, conn: &Connection, query: &str, workspace: &str, ) -> Result<()>
Record a search query for later analysis.
The query_log table must already exist (see CREATE_QUERY_LOG_TABLE).
Sourcepub fn get_frequent_topics(
&self,
conn: &Connection,
workspace: &str,
limit: usize,
) -> Result<Vec<(String, i64)>>
pub fn get_frequent_topics( &self, conn: &Connection, workspace: &str, limit: usize, ) -> Result<Vec<(String, i64)>>
Return the most frequently queried keywords for workspace.
Each query is split into lowercase words; counts are aggregated.
Returns at most limit results ordered by frequency descending.
limit = 0 returns all results.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InterestTracker
impl RefUnwindSafe for InterestTracker
impl Send for InterestTracker
impl Sync for InterestTracker
impl Unpin for InterestTracker
impl UnsafeUnpin for InterestTracker
impl UnwindSafe for InterestTracker
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.