Files
PaperClipAI/server
DottaandPaperclip 3a6ff11602 Use Levenshtein for fuzzy title matching (PAP-3452)
Replace the drop-one-character pg_trgm word_similarity approach with a
per-token Levenshtein check via fuzzystrmatch. The variant approach
generated noisy matches (e.g. "serac" -> "service", "seach" -> any word
containing "each") that surfaced unrelated issues at the top of fuzzy
result sets.

The new approach requires every fuzzy-eligible query token to land
within an edit distance budget of at least one title word, where the
budget is gated on the SHORTER of the two strings:

  shared length 6+: max 2 edits
  shared length 5: max 1 edit
  shared length 4: exact match only

That budget catches "serach" -> "search" (lev=2), "mibile" -> "mobile"
(lev=1) and "mobail" -> "mobile" (lev=2), while rejecting trigram-style
collisions like "serach" vs "each" (length-4 word, exact required) or
"reach" (length-5, lev=2 > 1).

Adds migration 0077 to enable the fuzzystrmatch contrib extension.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-03 17:55:55 -05:00
..
2026-03-12 13:09:22 -05:00