Skip to main content

suggest_sessions

Function suggest_sessions 

Source
pub fn suggest_sessions(
    query: &str,
    all_names: &[(String, String)],
    max_suggestions: usize,
) -> Vec<Suggestion>
Expand description

Suggest sessions similar to the given query.

Searches through all_names (a slice of (session_name, uuid) tuples) using three strategies:

  1. Levenshtein distance (case-insensitive) with scaled threshold
  2. Substring containment (case-insensitive)
  3. UUID prefix match (case-sensitive)

Results are sorted by distance ascending, then alphabetically for ties, and truncated to max_suggestions.