@@ -, +, @@ --- Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 1 + Koha/SearchEngine/Elasticsearch/Search.pm | 2 +- admin/searchengine/elasticsearch/mappings.yaml | 9 +++++++++ koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc | 1 + koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc | 1 + 5 files changed, 13 insertions(+), 1 deletion(-) --- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm +++ a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@ -118,6 +118,7 @@ sub build_query { location => { terms => { field => "location__facet" } }, 'su-geo' => { terms => { field => "su-geo__facet" } }, se => { terms => { field => "se__facet" } }, + ccode => { terms => { field => "ccode__facet" } }, }; my $display_library_facets = C4::Context->preference('DisplayLibraryFacets'); --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ a/Koha/SearchEngine/Elasticsearch/Search.pm @@ -146,7 +146,6 @@ sub search_compat { $servers, $results_per_page, $offset, $expanded_facet, $branches, $query_type, $scan ) = @_; - my %options; $options{offset} = $offset; $options{expanded_facet} = $expanded_facet; @@ -408,6 +407,7 @@ sub _convert_facets { 'su-geo' => { order => 4, label => 'Places', }, se => { order => 5, label => 'Series', }, subject => { order => 6, label => 'Topics', }, + ccode => { order => 7, label => 'CollectionCodes',}, holdingbranch => { order => 8, label => 'HoldingLibrary' }, homebranch => { order => 9, label => 'HomeLibrary' } ); --- a/admin/searchengine/elasticsearch/mappings.yaml +++ a/admin/searchengine/elasticsearch/mappings.yaml @@ -1255,6 +1255,15 @@ biblios: sort: ~ suggestible: '' type: '' + ccode: + label: collection-code + mappings: + - facet: '1' + marc_field: '9528' + marc_type: marc21 + sort: ~ + suggestible: '' + type: '' control-number: label: control-number mappings: --- a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc @@ -20,6 +20,7 @@ [% IF ( facets_loo.type_label_HomeLibrary ) %]Home libraries[% END %] [% IF ( facets_loo.type_label_HoldingLibrary ) %]Holding libraries[% END %] [% IF facets_loo.type_label_Location %]Locations[% END %] +[% IF facets_loo.type_label_CollectionCodes %]Collections[% END %]