Bug 19365: Fix search for duplicate authorities with Elasticsearch

Sponsored-by: National Library of Finland
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Ere Maijala 2018-09-17 00:10:22 +03:00 committed by Nick Clemens
parent be2bdfd511
commit a4c02b53cd
3 changed files with 8 additions and 6 deletions

View File

@ -760,7 +760,7 @@ sub FindDuplicateAuthority {
if ($QParser) {
$op = '&&';
} else {
$op = 'and';
$op = 'AND';
}
my $query='at:'.$authtypecode.' ';
my $filtervalues=qr([\001-\040\Q!'"`#$%&*+,-./:;<=>?@(){[}_|~\E\]]);

View File

@ -523,6 +523,8 @@ our %index_field_convert = (
'mus' => 'rtype',
'aud' => 'ta',
'hi' => 'Host-Item-Number',
'at' => 'authtype',
'he' => 'Heading'
);
sub _convert_index_fields {

View File

@ -344,11 +344,11 @@ sub simple_search_compat {
}
my $results = $self->search($query, undef, $max_results, %options);
my @records;
$results->each(sub {
my $marc = $self->decode_record_from_result(@_);
push @records, $marc;
});
return (undef, \@records, $results->total);
my $hits = $results->{'hits'};
foreach my $es_record (@{$hits->{'hits'}}) {
push @records, $self->decode_record_from_result($es_record->{'_source'});
}
return (undef, \@records, $hits->{'total'});
}
=head2 extract_biblionumber