@@ -, +, @@ --- C4/XSLT.pm | 7 ++++++- Koha/Biblio.pm | 5 ++--- admin/searchengine/elasticsearch/mappings.yaml | 9 +++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) --- a/C4/XSLT.pm +++ a/C4/XSLT.pm @@ -282,9 +282,14 @@ sub XSLTParse4Display { if ( $biblio->components() ) { my @componentPartRecordXML = (''); 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, ''; $partsxml = join "\n", @componentPartRecordXML; --- a/Koha/Biblio.pm +++ a/Koha/Biblio.pm @@ -524,12 +524,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"; --- a/admin/searchengine/elasticsearch/mappings.yaml +++ a/admin/searchengine/elasticsearch/mappings.yaml @@ -1621,6 +1621,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: --