kernl API
    Preparing search index...

    Function fuzzyScore

    • How well one search word matches a field: a whole-word hit beats a prefix, a prefix beats a substring, and a substring beats the word's letters appearing in order within one word of the field, which forgives a typo without letting a long description match anything. Zero when none hold.

      Parameters

      • word: string

        One lower-case search word.

      • field: string

        Lower-case field text.

      Returns number

      A score from 0 to 4.

      fuzzyScore('chess', 'chess club'); // 4
      fuzzyScore('chss', 'chess club'); // 1