View | Details | Raw Unified | Return to bug 36437
Collapse All | Expand All

(-)a/Koha/SearchEngine/Elasticsearch.pm (-1 / +1 lines)
Lines 1404-1410 sub get_facetable_fields { Link Here
1404
1404
1405
    # These should correspond to the ES field names, as opposed to the CCL
1405
    # These should correspond to the ES field names, as opposed to the CCL
1406
    # things that zebra uses.
1406
    # things that zebra uses.
1407
    my @search_field_names = qw( author itype location su-geo title-series subject ccode holdingbranch homebranch ln );
1407
    my @search_field_names = qw( author itype location su-geo title-series subject ccode holdingbranch homebranch ln date-of-publication );
1408
    my @faceted_fields = Koha::SearchFields->search(
1408
    my @faceted_fields = Koha::SearchFields->search(
1409
        { name => { -in => \@search_field_names }, facet_order => { '!=' => undef } }, { order_by => ['facet_order'] }
1409
        { name => { -in => \@search_field_names }, facet_order => { '!=' => undef } }, { order_by => ['facet_order'] }
1410
    )->as_list;
1410
    )->as_list;
(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (-8 / +9 lines)
Lines 226-239 sub build_query { Link Here
226
    # things that Koha can use.
226
    # things that Koha can use.
227
    my $size = C4::Context->preference('FacetMaxCount');
227
    my $size = C4::Context->preference('FacetMaxCount');
228
    $res->{aggregations} = {
228
    $res->{aggregations} = {
229
        author         => { terms => { field => "author__facet" , size => $size } },
229
        author                => { terms => { field => "author__facet" , size => $size } },
230
        subject        => { terms => { field => "subject__facet", size => $size } },
230
        subject               => { terms => { field => "subject__facet", size => $size } },
231
        itype          => { terms => { field => "itype__facet", size => $size} },
231
        itype                 => { terms => { field => "itype__facet", size => $size} },
232
        location       => { terms => { field => "location__facet", size => $size } },
232
        location              => { terms => { field => "location__facet", size => $size } },
233
        'su-geo'       => { terms => { field => "su-geo__facet", size => $size} },
233
        'su-geo'              => { terms => { field => "su-geo__facet", size => $size} },
234
        'title-series' => { terms => { field => "title-series__facet", size => $size } },
234
        'title-series'        => { terms => { field => "title-series__facet", size => $size } },
235
        ccode          => { terms => { field => "ccode__facet", size => $size } },
235
        ccode                 => { terms => { field => "ccode__facet", size => $size } },
236
        ln             => { terms => { field => "ln__facet", size => $size } },
236
        ln                    => { terms => { field => "ln__facet", size => $size } },
237
        'date-of-publication' => { terms => { field => "date-of-publication__facet", size => $size } },
237
    };
238
    };
238
239
239
    my $display_library_facets = C4::Context->preference('DisplayLibraryFacets');
240
    my $display_library_facets = C4::Context->preference('DisplayLibraryFacets');
(-)a/Koha/SearchEngine/Elasticsearch/Search.pm (-10 / +11 lines)
Lines 444-459 sub _convert_facets { Link Here
444
    # things that zebra uses.
444
    # things that zebra uses.
445
    my %type_to_label;
445
    my %type_to_label;
446
    my %label = (
446
    my %label = (
447
        author         => 'Authors',
447
        author                => 'Authors',
448
        itype          => 'ItemTypes',
448
        itype                 => 'ItemTypes',
449
        location       => 'Location',
449
        location              => 'Location',
450
        'su-geo'       => 'Places',
450
        'su-geo'              => 'Places',
451
        'title-series' => 'Series',
451
        'title-series'        => 'Series',
452
        subject        => 'Topics',
452
        subject               => 'Topics',
453
        ccode          => 'CollectionCodes',
453
        ccode                 => 'CollectionCodes',
454
        holdingbranch  => 'HoldingLibrary',
454
        holdingbranch         => 'HoldingLibrary',
455
        homebranch     => 'HomeLibrary',
455
        homebranch            => 'HomeLibrary',
456
        ln             => 'Language',
456
        ln                    => 'Language',
457
        'date-of-publication' => 'PubDate',
457
    );
458
    );
458
    my @facetable_fields =
459
    my @facetable_fields =
459
      Koha::SearchEngine::Elasticsearch->get_facetable_fields;
460
      Koha::SearchEngine::Elasticsearch->get_facetable_fields;
(-)a/admin/searchengine/elasticsearch/mappings.yaml (-10 / +11 lines)
Lines 1280-1286 biblios: Link Here
1280
    staff_client: 1
1280
    staff_client: 1
1281
    type: ''
1281
    type: ''
1282
  ccode:
1282
  ccode:
1283
    facet_order: 7
1283
    facet_order: 8
1284
    label: collection-code
1284
    label: collection-code
1285
    mandatory: ~
1285
    mandatory: ~
1286
    mappings:
1286
    mappings:
Lines 1656-1670 biblios: Link Here
1656
    staff_client: 1
1656
    staff_client: 1
1657
    type: date
1657
    type: date
1658
  date-of-publication:
1658
  date-of-publication:
1659
    facet_order: 3
1659
    label: date-of-publication
1660
    label: date-of-publication
1660
    mandatory: ~
1661
    mandatory: ~
1661
    mappings:
1662
    mappings:
1662
    - facet: ''
1663
    - facet: 1
1663
      marc_field: 008_/7-10
1664
      marc_field: 008_/7-10
1664
      marc_type: marc21
1665
      marc_type: marc21
1665
      sort: 1
1666
      sort: 1
1666
      suggestible: ''
1667
      suggestible: ''
1667
    - facet: ''
1668
    - facet: 1
1668
      marc_field: 100a_/9-12
1669
      marc_field: 100a_/9-12
1669
      marc_type: unimarc
1670
      marc_type: unimarc
1670
      sort: 1
1671
      sort: 1
Lines 1856-1862 biblios: Link Here
1856
    staff_client: 1
1857
    staff_client: 1
1857
    type: ''
1858
    type: ''
1858
  holdingbranch:
1859
  holdingbranch:
1859
    facet_order: 8
1860
    facet_order: 9
1860
    label: holdinglibrary
1861
    label: holdinglibrary
1861
    mandatory: ~
1862
    mandatory: ~
1862
    mappings:
1863
    mappings:
Lines 1874-1880 biblios: Link Here
1874
    staff_client: 1
1875
    staff_client: 1
1875
    type: string
1876
    type: string
1876
  homebranch:
1877
  homebranch:
1877
    facet_order: 9
1878
    facet_order: 10
1878
    label: homelibrary
1879
    label: homelibrary
1879
    mandatory: ~
1880
    mandatory: ~
1880
    mappings:
1881
    mappings:
Lines 2484-2490 biblios: Link Here
2484
    staff_client: 1
2485
    staff_client: 1
2485
    type: ''
2486
    type: ''
2486
  ln:
2487
  ln:
2487
    facet_order: 10
2488
    facet_order: 11
2488
    label: ln
2489
    label: ln
2489
    mandatory: ~
2490
    mandatory: ~
2490
    mappings:
2491
    mappings:
Lines 2565-2571 biblios: Link Here
2565
    staff_client: 1
2566
    staff_client: 1
2566
    type: number
2567
    type: number
2567
  location:
2568
  location:
2568
    facet_order: 3
2569
    facet_order: 4
2569
    label: location
2570
    label: location
2570
    mandatory: ~
2571
    mandatory: ~
2571
    mappings:
2572
    mappings:
Lines 3351-3357 biblios: Link Here
3351
    staff_client: 1
3352
    staff_client: 1
3352
    type: ''
3353
    type: ''
3353
  su-geo:
3354
  su-geo:
3354
    facet_order: 4
3355
    facet_order: 5
3355
    label: su-geo
3356
    label: su-geo
3356
    mandatory: ~
3357
    mandatory: ~
3357
    mappings:
3358
    mappings:
Lines 3369-3375 biblios: Link Here
3369
    staff_client: 1
3370
    staff_client: 1
3370
    type: string
3371
    type: string
3371
  subject:
3372
  subject:
3372
    facet_order: 6
3373
    facet_order: 7
3373
    label: subject
3374
    label: subject
3374
    mandatory: ~
3375
    mandatory: ~
3375
    mappings:
3376
    mappings:
Lines 4131-4137 biblios: Link Here
4131
    staff_client: 1
4132
    staff_client: 1
4132
    type: ''
4133
    type: ''
4133
  title-series:
4134
  title-series:
4134
    facet_order: 5
4135
    facet_order: 6
4135
    label: title-series
4136
    label: title-series
4136
    mandatory: ~
4137
    mandatory: ~
4137
    mappings:
4138
    mappings:
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc (+3 lines)
Lines 84-89 Link Here
84
                            [% IF facets_loo.type_label_Language %]
84
                            [% IF facets_loo.type_label_Language %]
85
                                <span id="facet-languages">Languages</span>
85
                                <span id="facet-languages">Languages</span>
86
                            [% END %]
86
                            [% END %]
87
                            [% IF facets_loo.type_label_PubDate %]
88
                                <span id="facet-pubdates">Publication years</span>
89
                            [% END %]
87
                            <ul>
90
                            <ul>
88
                                [% SET url = "/cgi-bin/koha/catalogue/search.pl?" _ query_cgi _ limit_cgi %]
91
                                [% SET url = "/cgi-bin/koha/catalogue/search.pl?" _ query_cgi _ limit_cgi %]
89
                                [% IF ( sort_by ) %]
92
                                [% IF ( sort_by ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt (-1 / +2 lines)
Lines 482-488 a.add, a.delete { Link Here
482
                                                    [% CASE 'holdingbranch' %]<span>Holding libraries</span>
482
                                                    [% CASE 'holdingbranch' %]<span>Holding libraries</span>
483
                                                    [% CASE 'homebranch' %]<span>Home libraries</span>
483
                                                    [% CASE 'homebranch' %]<span>Home libraries</span>
484
                                                    [% CASE 'ln' %]<span>Language</span>
484
                                                    [% CASE 'ln' %]<span>Language</span>
485
                                                    [% CASE %][% f | html %]
485
                                                    [% CASE 'date-of-publication' %]<span>Publication year</span>
486
                                                    [% CASE %][% f.name | html %]
486
                                                    [% END %]
487
                                                    [% END %]
487
                                                </td>
488
                                                </td>
488
                                                <td>
489
                                                <td>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc (-1 / +2 lines)
Lines 51-56 Link Here
51
            [% more_less_labels.HomeLibrary     = { more = t("Show more home libraries"),    less = t("Show fewer home libraries") }    %]
51
            [% more_less_labels.HomeLibrary     = { more = t("Show more home libraries"),    less = t("Show fewer home libraries") }    %]
52
            [% more_less_labels.HoldingLibrary  = { more = t("Show more holding libraries"), less = t("Show fewer holding libraries") } %]
52
            [% more_less_labels.HoldingLibrary  = { more = t("Show more holding libraries"), less = t("Show fewer holding libraries") } %]
53
            [% more_less_labels.Location        = { more = t("Show more locations"),         less = t("Show fewer locations") }         %]
53
            [% more_less_labels.Location        = { more = t("Show more locations"),         less = t("Show fewer locations") }         %]
54
            [% more_less_labels.PubDate         = { more = t("Show more publication years"), less = t("Show fewer publication years") } %]
54
            [% FOREACH facets_loo IN facets_loop %]
55
            [% FOREACH facets_loo IN facets_loop %]
55
                [% IF facets_loo.facets.size > 0 %]
56
                [% IF facets_loo.facets.size > 0 %]
56
                    <li id="[% facets_loo.type_id | html %]">
57
                    <li id="[% facets_loo.type_id | html %]">
Lines 62-67 Link Here
62
                        [% IF facets_loo.type_label_ItemTypes %]<h3 id="facet-itemtypes">Item types</h3>[% END %]
63
                        [% IF facets_loo.type_label_ItemTypes %]<h3 id="facet-itemtypes">Item types</h3>[% END %]
63
                        [% IF facets_loo.type_label_CollectionCodes %]<h3 id="facet-collections">Collections</h3>[% END %]
64
                        [% IF facets_loo.type_label_CollectionCodes %]<h3 id="facet-collections">Collections</h3>[% END %]
64
                        [% IF facets_loo.type_label_Language %]<h3 id="facet-languages">Languages</h3>[% END %]
65
                        [% IF facets_loo.type_label_Language %]<h3 id="facet-languages">Languages</h3>[% END %]
66
                        [% IF facets_loo.type_label_PubDate %]<h3 id="facet-pubdates">Publication years</h3>[% END %]
65
                        [% UNLESS singleBranchMode %]
67
                        [% UNLESS singleBranchMode %]
66
                            [% IF ( facets_loo.type_label_HomeLibrary ) %]<h3 id="facet-home-libraries">Home libraries</h3>[% END %]
68
                            [% IF ( facets_loo.type_label_HomeLibrary ) %]<h3 id="facet-home-libraries">Home libraries</h3>[% END %]
67
                            [% IF ( facets_loo.type_label_HoldingLibrary ) %]<h3 id="facet-holding-libraries">Holding libraries</h3>[% END %]
69
                            [% IF ( facets_loo.type_label_HoldingLibrary ) %]<h3 id="facet-holding-libraries">Holding libraries</h3>[% END %]
68
- 

Return to bug 36437