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

(-)a/C4/Search.pm (-5 / +3 lines)
Lines 588-594 sub getRecords { Link Here
588
                }
588
                }
589
            }
589
            }
590
        );
590
        );
591
592
    # This sorts the facets into alphabetical order
591
    # This sorts the facets into alphabetical order
593
    if (@facets_loop) {
592
    if (@facets_loop) {
594
        foreach my $f (@facets_loop) {
593
        foreach my $f (@facets_loop) {
Lines 626-632 sub _get_facets_from_records { Link Here
626
    my $jmax           = $size > $facets_maxrecs
625
    my $jmax           = $size > $facets_maxrecs
627
                            ? $facets_maxrecs
626
                            ? $facets_maxrecs
628
                            : $size;
627
                            : $size;
629
630
    for ( my $j = 0 ; $j < $jmax ; $j++ ) {
628
    for ( my $j = 0 ; $j < $jmax ; $j++ ) {
631
629
632
        my $marc_record = new_record_from_zebra (
630
        my $marc_record = new_record_from_zebra (
Lines 661-669 facets for Zebra). Link Here
661
sub _get_facets_data_from_record {
659
sub _get_facets_data_from_record {
662
660
663
    my ( $marc_record, $facets, $facets_counter ) = @_;
661
    my ( $marc_record, $facets, $facets_counter ) = @_;
664
665
    for my $facet (@$facets) {
662
    for my $facet (@$facets) {
666
667
        my @used_datas = ();
663
        my @used_datas = ();
668
664
669
        foreach my $tag ( @{ $facet->{ tags } } ) {
665
        foreach my $tag ( @{ $facet->{ tags } } ) {
Lines 680-685 sub _get_facets_data_from_record { Link Here
680
                next if $field->indicator(1) eq 'z';
676
                next if $field->indicator(1) eq 'z';
681
677
682
                my $data = $field->as_string( $subfield_letters, $facet->{ sep } );
678
                my $data = $field->as_string( $subfield_letters, $facet->{ sep } );
679
                $data =~ s/\s*(?<![A-Z])[.\-,;]\s*$//;
683
680
684
                unless ( grep { $_ eq $data } @used_datas ) {
681
                unless ( grep { $_ eq $data } @used_datas ) {
685
                    push @used_datas, $data;
682
                    push @used_datas, $data;
Lines 778-785 sub _get_facet_from_result_set { Link Here
778
    my $facets = {};
775
    my $facets = {};
779
    foreach my $term ( @terms ) {
776
    foreach my $term ( @terms ) {
780
        my $facet_value = $term->textContent;
777
        my $facet_value = $term->textContent;
778
        $facet_value =~ s/\s*(?<![A-Z])[.\-,;]\s*$//;
781
        $facet_value =~ s/\Q$internal_sep\E/$sep/ if defined $sep;
779
        $facet_value =~ s/\Q$internal_sep\E/$sep/ if defined $sep;
782
        $facets->{ $facet_value } = $term->getAttribute( 'occur' );
780
        $facets->{ $facet_value } =  ( defined $facets->{$facet_value} ) ? $facets->{ $facet_value } + $term->getAttribute( 'occur' ) : $term->getAttribute( 'occur' );
783
    }
781
    }
784
782
785
    return $facets;
783
    return $facets;
(-)a/admin/searchengine/elasticsearch/field_config.yaml (+1 lines)
Lines 54-59 search: Link Here
54
facet:
54
facet:
55
  default:
55
  default:
56
    type: keyword
56
    type: keyword
57
    normalizer: facet_normalizer
57
# Suggestible
58
# Suggestible
58
suggestible:
59
suggestible:
59
  default:
60
  default:
(-)a/admin/searchengine/elasticsearch/index_config.yaml (-1 / +6 lines)
Lines 28-33 index: Link Here
28
      nfkc_cf_normalizer:
28
      nfkc_cf_normalizer:
29
        type: custom
29
        type: custom
30
        char_filter: icu_normalizer
30
        char_filter: icu_normalizer
31
      facet_normalizer:
32
        char_filter: facet
31
    char_filter:
33
    char_filter:
32
      # The punctuation filter is used to remove any punctuation chars in fields that don't use icu_tokenizer.
34
      # The punctuation filter is used to remove any punctuation chars in fields that don't use icu_tokenizer.
33
      punctuation:
35
      punctuation:
Lines 35-38 index: Link Here
35
        # The pattern contains all ASCII punctuation characters.
37
        # The pattern contains all ASCII punctuation characters.
36
        pattern: '([\x00-\x1F,\x21-\x2F,\x3A-\x40,\x5B-\x60,\x7B-\x89,\x8B,\x8D,\x8F,\x90-\x99,\x9B,\x9D,\xA0-\xBF,\xD7,\xF7])'
38
        pattern: '([\x00-\x1F,\x21-\x2F,\x3A-\x40,\x5B-\x60,\x7B-\x89,\x8B,\x8D,\x8F,\x90-\x99,\x9B,\x9D,\xA0-\xBF,\xD7,\xF7])'
37
        replacement: ''
39
        replacement: ''
40
      facet:
41
        type: pattern_replace
42
        pattern: '\s*(?<![A-Z])[.\-,;]\s*$'
43
        replacement: ''
38
index.mapping.total_fields.limit: 10000
44
index.mapping.total_fields.limit: 10000
39
- 

Return to bug 17661