search_official

Function search_official 

Source
pub fn search_official(
    query: &str,
    fuzzy: bool,
) -> Vec<(PackageItem, Option<i64>)>
Expand description

What: Search the official index for packages whose names match query.

Inputs:

  • query: Raw query string
  • fuzzy: When true, uses fuzzy matching (fzf-style); when false, uses substring matching

Output:

  • Vector of PackageItems populated from the index; enrichment is not performed here. An empty or whitespace-only query returns an empty list. When fuzzy mode is enabled, items are returned with scores for sorting.

Details:

  • When fuzzy is false, performs a case-insensitive substring match on package names.
  • When fuzzy is true, uses fuzzy matching and returns items with match scores.