Bugzilla – Attachment 64326 Details for
Bug 17710
C4::Matcher::get_matches and C4::ImportBatch::GetBestRecordMatch should use same logic
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17710 - C4::Matcher::get_matches and C4::ImportBatch::GetBestRecordMatch should use same logic
Bug-17710---C4Matchergetmatches-and-C4ImportBatchG.patch (text/plain), 1.31 KB, created by
Kyle M Hall (khall)
on 2017-06-15 13:50:29 UTC
(
hide
)
Description:
Bug 17710 - C4::Matcher::get_matches and C4::ImportBatch::GetBestRecordMatch should use same logic
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2017-06-15 13:50:29 UTC
Size:
1.31 KB
patch
obsolete
>From 03119fe47d048abc6b98917e73c98dc73b9ab0ea Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Wed, 11 Jan 2017 15:36:05 +1100 >Subject: [PATCH] Bug 17710 - C4::Matcher::get_matches and > C4::ImportBatch::GetBestRecordMatch should use same logic > >C4::ImportBatch::GetBestRecordMatch uses SQL to sort by score descending >then candidate_match_id descending. With C4::Matcher::get_matches, I >implement the same sort but use Perl code to do it, since we're sorting >search results. > >It's a simple change, but it's in a big block of code, so I don't have >unit tests. > >Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Matcher.pm | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/C4/Matcher.pm b/C4/Matcher.pm >index 670b2ef..aaead2f 100644 >--- a/C4/Matcher.pm >+++ b/C4/Matcher.pm >@@ -724,7 +724,10 @@ sub get_matches { > push @results, { 'record_id' => $authid, 'score' => $matches{$authid} }; > } > } >- @results = sort { $b->{'score'} cmp $a->{'score'} } @results; >+ @results = sort { >+ $b->{'score'} cmp $a->{'score'} or >+ $b->{'record_id'} cmp $a->{'record_id'} >+ } @results; > if (scalar(@results) > $max_matches) { > @results = @results[0..$max_matches-1]; > } >-- >2.10.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17710
:
58859
|
63771
| 64326