Browse Source

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>
21.11.x
Nick Clemens 1 year ago
committed by Jonathan Druart
parent
commit
cc7fb7a7fb
  1. 7
      C4/XSLT.pm
  2. 5
      Koha/Biblio.pm
  3. 9
      admin/searchengine/elasticsearch/mappings.yaml

7
C4/XSLT.pm

@ -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;

5
Koha/Biblio.pm

@ -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";

9
admin/searchengine/elasticsearch/mappings.yaml

@ -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:

Loading…
Cancel
Save