Bug 11175: Add Elasticsearch support

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Nick Clemens 2020-11-02 14:59:33 +00:00 committed by Jonathan Druart
parent c14ff59f73
commit cc7fb7a7fb
3 changed files with 17 additions and 4 deletions

View file

@ -296,9 +296,14 @@ sub XSLTParse4Display {
if ( $biblio->components() ) {
my @componentPartRecordXML = ('<componentPartRecords>');
for my $cb ( @{ $biblio->components() } ) {
if( ref $cb eq 'MARC::Record'){
$cb = $cb->as_xml_record();
} else {
$cb = decode('utf8', $cb);
}
# Remove the xml header
$cb =~ s/^<\?xml.*?\?>//;
push @componentPartRecordXML, decode('utf8', $cb);
push @componentPartRecordXML,$cb;
}
push @componentPartRecordXML, '</componentPartRecords>';
$partsxml = join "\n", @componentPartRecordXML;

View file

@ -505,12 +505,11 @@ sub components {
$searchstr = "rcn='".$pf001->data()."'";
} else {
# search for (773$w='Host001' and 003='Host003') or 773$w='Host003 Host001')
$searchstr = "(rcn='".$pf001->data()."' and cni='".$pf003->data()."')";
$searchstr .= " or rcn='".$pf003->data()." ".$pf001->data()."'";
$searchstr = "(rcn='".$pf001->data()."' AND cni='".$pf003->data()."')";
$searchstr .= " OR rcn='".$pf003->data()." ".$pf001->data()."'";
}
my ( $errors, $results, $total_hits ) = $searcher->simple_search_compat( $searchstr, 0, undef );
$self->{_components} = $results if ( defined($results) && scalar(@$results) );
} else {
warn "Record $self->id has no 001";

View file

@ -1251,6 +1251,15 @@ biblios:
sort: ~
suggestible: ''
type: ''
control-number-identifier:
label: control-number-identifier
mappings:
- facet: ''
marc_field: 003
marc_type: marc21
sort: ~
suggestible: ''
type: ''
copydate:
label: copydate
mappings: