Browse Source

Bug 18235: (QA follow-up) Series facet name after rebase

Bug 19575 changes many field names so "se" facet field became "title-series"

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Josef Moravec 2 years ago
committed by Nick Clemens
parent
commit
eba6327299
  1. 2
      Koha/SearchEngine/Elasticsearch.pm
  2. 2
      installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.perl
  3. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt
  4. 6
      t/db_dependent/Koha_Elasticsearch.t

2
Koha/SearchEngine/Elasticsearch.pm

@ -985,7 +985,7 @@ sub get_facetable_fields {
# These should correspond to the ES field names, as opposed to the CCL
# things that zebra uses.
my @search_field_names = qw( author itype location su-geo se subject ccode holdingbranch homebranch );
my @search_field_names = qw( author itype location su-geo title-series subject ccode holdingbranch homebranch );
my @faceted_fields = Koha::SearchFields->search(
{ name => { -in => \@search_field_names }, facet_order => { '!=' => undef } }, { order_by => ['facet_order'] }
);

2
installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.perl

@ -8,7 +8,7 @@ if( CheckVersion( $DBversion ) ) {
$dbh->do("UPDATE search_field SET facet_order=2 WHERE name='itype'");
$dbh->do("UPDATE search_field SET facet_order=3 WHERE name='location'");
$dbh->do("UPDATE search_field SET facet_order=4 WHERE name='su-geo'");
$dbh->do("UPDATE search_field SET facet_order=5 WHERE name='se'");
$dbh->do("UPDATE search_field SET facet_order=5 WHERE name='title-series'");
$dbh->do("UPDATE search_field SET facet_order=6 WHERE name='subject'");
$dbh->do("UPDATE search_field SET facet_order=7 WHERE name='ccode'");
$dbh->do("UPDATE search_field SET facet_order=8 WHERE name='holdingbranch'");

2
koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt

@ -364,7 +364,7 @@ a.add, a.delete {
[% CASE 'itype' %]Item Types
[% CASE 'location' %]Locations
[% CASE 'su-geo' %]Places
[% CASE 'se' %]Series
[% CASE 'title-series' %]Series
[% CASE 'subject' %]Topics
[% CASE 'ccode' %]Collections
[% CASE 'holdingbranch' %]Holding libraries

6
t/db_dependent/Koha_Elasticsearch.t

@ -74,8 +74,8 @@ subtest 'get_facetable_fields() tests' => sub {
$builder->build({
source => 'SearchField',
value => {
name => 'se',
label => 'se',
name => 'title-series',
label => 'titles-series',
type => 'string',
facet_order => 4
}
@ -117,7 +117,7 @@ subtest 'get_facetable_fields() tests' => sub {
is($faceted_fields[1]->facet_order, 2);
is($faceted_fields[2]->name, 'itype');
is($faceted_fields[2]->facet_order, 3);
is($faceted_fields[3]->name, 'se');
is($faceted_fields[3]->name, 'title-series');
is($faceted_fields[3]->facet_order, 4);
is($faceted_fields[4]->name, 'su-geo');
is($faceted_fields[4]->facet_order, 5);

Loading…
Cancel
Save