Documentation
¶
Index ¶
Constants ¶
const ( WeightDisplayNameExact = 100 WeightDisplayNameFuzzy = 50 WeightNameExact = 80 WeightNameFuzzy = 40 WeightTitleExact = 60 WeightTitleFuzzy = 30 WeightParticipantExact = 20 WeightParticipantFuzzy = 10 )
Field weight constants for relevance scoring. Exact substring matches score higher than fuzzy matches.
Variables ¶
This section is empty.
Functions ¶
func ScoreField ¶
ScoreField scores a single field against the query. Returns exactWeight for substring match, fuzzyWeight for fuzzy-only match, 0 otherwise.
func ScoreThread ¶
ScoreThread returns a relevance score for a thread against the query. Returns 0 if the thread does not match. Empty query matches everything with score 1. Multi-term queries use AND logic: all terms must match somewhere. When includeSelf is false, self participants are excluded from matching (contacts mode). When includeSelf is true, all participants are included (chats mode).
func SortByScoreAndActivity ¶
SortByScoreAndActivity sorts scored threads by score descending, then by LastActivity descending (most recent first) as a tiebreaker.
func TermMatchesAnyField ¶
TermMatchesAnyField checks if a single term matches any of the given fields via case-insensitive substring or fuzzy match.