From 7c78e4c97e258c829d09e2d48081efc065619651 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 1 Nov 2017 16:13:23 +0000 Subject: [PATCH] Bug 18131: Followup - Use data if biblionumber_tag < 10 Signed-off-by: Julian Maurice Signed-off-by: Jonathan Druart --- C4/Matcher.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/Matcher.pm b/C4/Matcher.pm index 82840ebec1..7209511d76 100644 --- a/C4/Matcher.pm +++ b/C4/Matcher.pm @@ -675,7 +675,9 @@ sub get_matches { if ( C4::Context->preference('SearchEngine') eq 'Elasticsearch' ) { foreach my $matched ( @{$searchresults} ) { my ( $biblionumber_tag, $biblionumber_subfield ) = C4::Biblio::GetMarcFromKohaField( "biblio.biblionumber", $marcframework_used ); - my $id = $matched->field($biblionumber_tag)->subfield($biblionumber_subfield); + my $id = ( $biblionumber_tag > 10 ) ? + $matched->field($biblionumber_tag)->subfield($biblionumber_subfield) : + $matched->field($biblionumber_tag)->data(); $matches->{$id}->{score} += $matchpoint->{score}; $matches->{$id}->{record} = $matched; } -- 2.39.5