check_duplicates.php's logic moves to services/SimilarTicketService.php
(used next by the MCP find_similar_tickets tool). Fixes found while
testing it:
- Non-admins never got matches: the query had no `t` alias but the
visibility filter's SQL uses t.*, so it failed and the error was
swallowed into "no duplicates".
- The word-overlap scoring could never fire, since candidates were only
whole-title substring or SOUNDEX matches. Tickets sharing a significant
word (4+ letters) are now candidates too; overlap needs 2+ shared words
so one common word (e.g. every automated ticket's [problem] tag) isn't
a match.
- SOUNDEX compared PHP's 4-char code (effectively the first word) with
MariaDB's full-length code: the SQL side almost never matched, and the
scorer marked any two titles sharing a first word as "sounds alike".
Both sides now use SQL SOUNDEX on the full title.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MGDKHiU5RJdo3dqQUDow3X