mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-06-01 03:09:43 +00:00
feat(fuzzy-match): sort results by similarity score descending
Most similar pairs now appear at the top of the table. Removed the unused __lt__ on _WorkResult (no longer needed). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,9 +27,6 @@ class _WorkResult:
|
||||
doc_two_pk: int
|
||||
ratio: float
|
||||
|
||||
def __lt__(self, other: "_WorkResult") -> bool:
|
||||
return self.doc_one_pk < other.doc_one_pk
|
||||
|
||||
|
||||
def _process_and_match(work: _WorkPackage) -> _WorkResult:
|
||||
"""
|
||||
@@ -206,7 +203,7 @@ class Command(PaperlessCommand):
|
||||
):
|
||||
yield proc_result.result
|
||||
|
||||
matches = sorted(_iter_matches())
|
||||
matches = sorted(_iter_matches(), key=lambda m: m.ratio, reverse=True)
|
||||
maybe_delete_ids = self._render_results(
|
||||
matches,
|
||||
opt_ratio=opt_ratio,
|
||||
|
||||
Reference in New Issue
Block a user