bitmagnet-io / bitmagnet

A self-hosted BitTorrent indexer, DHT crawler, content classifier and torrent search engine with web UI, GraphQL API and Servarr stack integration.
https://bitmagnet.io/
MIT License
2.51k stars 102 forks source link

patch localsearch and tmdbsearch to return match with lowest distance #336

Closed rraymondgh closed 1 month ago

rraymondgh commented 1 month ago
select * from content
where title ilike '%redacted%'
and type = 'tv_show'

returns 7 rows, where required row in row 7 and row 2 has a title that has a Levenshtein distance <= 5. Change local search to pick result with lowest Levenshtein distance <=5 instead of first row with Levenshtein distance <=5

Same issue has not been observed with TMDB search, however it had same potentially flawed logic as local search. Changed to be consistent logic.

Have run bitmagnet reprocess --classifyMode rematch across database with > 400k torrents. Have observed both local search and TMDB search to be working as expected with this patch

mgdigital commented 1 month ago

Thanks @rraymondgh , merging this to an internal branch as I need to make a few tweaks

mgdigital commented 1 month ago

See https://github.com/bitmagnet-io/bitmagnet/pull/336