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

(-)a/C4/Search.pm (+6 lines)
Lines 390-395 sub getRecords { Link Here
390
            elsif ( $sort eq "title_za" || $sort eq "title_dsc" ) {
390
            elsif ( $sort eq "title_za" || $sort eq "title_dsc" ) {
391
                $sort_by .= "1=4 >i ";
391
                $sort_by .= "1=4 >i ";
392
            }
392
            }
393
            elsif ( $sort eq "biblionumber_az" || $sort eq "biblionumber_asc" ) {
394
                $sort_by .= "1=12 s=109 0 ";
395
            }
396
            elsif ( $sort eq "biblionumber_za" || $sort eq "biblionumber_dsc" ) {
397
                $sort_by .= "1=12 s=109 1 ";
398
            }
393
            else {
399
            else {
394
                warn "Ignoring unrecognized sort '$sort' requested" if $sort_by;
400
                warn "Ignoring unrecognized sort '$sort' requested" if $sort_by;
395
            }
401
            }
(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (+1 lines)
Lines 694-699 sub _convert_sort_fields { Link Here
694
        relevance   => undef,       # default
694
        relevance   => undef,       # default
695
        title       => 'title',
695
        title       => 'title',
696
        pubdate     => 'date-of-publication',
696
        pubdate     => 'date-of-publication',
697
        biblionumber=> 'local-number',
697
    );
698
    );
698
    my %sort_order_convert =
699
    my %sort_order_convert =
699
      ( qw( desc desc ), qw( dsc desc ), qw( asc asc ), qw( az asc ), qw( za desc ) );
700
      ( qw( desc desc ), qw( dsc desc ), qw( asc asc ), qw( az asc ), qw( za desc ) );
(-)a/admin/searchengine/elasticsearch/mappings.yaml (-5 / +5 lines)
Lines 768-781 authorities: Link Here
768
      - facet: ''
768
      - facet: ''
769
        marc_field: 001
769
        marc_field: 001
770
        marc_type: marc21
770
        marc_type: marc21
771
        sort: ~
771
        sort: 1
772
        suggestible: ''
772
        suggestible: ''
773
      - facet: ''
773
      - facet: ''
774
        marc_field: 001
774
        marc_field: 001
775
        marc_type: unimarc
775
        marc_type: unimarc
776
        sort: ~
776
        sort: 1
777
        suggestible: ''
777
        suggestible: ''
778
    type: string
778
    type: number
779
  personal-name:
779
  personal-name:
780
    label: personal-name
780
    label: personal-name
781
    mappings:
781
    mappings:
Lines 2158-2169 biblios: Link Here
2158
      - facet: ''
2158
      - facet: ''
2159
        marc_field: 999c
2159
        marc_field: 999c
2160
        marc_type: marc21
2160
        marc_type: marc21
2161
        sort: 0
2161
        sort: 1
2162
        suggestible: ''
2162
        suggestible: ''
2163
      - facet: ''
2163
      - facet: ''
2164
        marc_field: 001
2164
        marc_field: 001
2165
        marc_type: unimarc
2165
        marc_type: unimarc
2166
        sort: 0
2166
        sort: 1
2167
        suggestible: ''
2167
        suggestible: ''
2168
    type: string
2168
    type: string
2169
  location:
2169
  location:
(-)a/etc/zebradb/ccl.properties (-1 / +1 lines)
Lines 326-332 lc-card LC-card-number Link Here
326
#                           system (i.e., any system that
326
#                           system (i.e., any system that
327
#                           is not one of the four listed
327
#                           is not one of the four listed
328
#                           above).
328
#                           above).
329
Local-number 1=12
329
Local-number 1=12 s=109
330
sn Local-number
330
sn Local-number
331
331
332
#Date                   30  The point of time at which      005, 008/00-05,
332
#Date                   30  The point of time at which      005, 008/00-05,
(-)a/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml (+3 lines)
Lines 9-14 Link Here
9
  <index_control_field tag="001">
9
  <index_control_field tag="001">
10
    <target_index>Local-number:n</target_index>
10
    <target_index>Local-number:n</target_index>
11
  </index_control_field>
11
  </index_control_field>
12
  <index_control_field tag="001">
13
    <target_index>Local-number:s</target_index>
14
  </index_control_field>
12
  <!--record.abs line 26: melm 009      Identifier-standard:w,Identifier-standard:n-->
15
  <!--record.abs line 26: melm 009      Identifier-standard:w,Identifier-standard:n-->
13
  <index_control_field tag="009">
16
  <index_control_field tag="009">
14
    <target_index>Identifier-standard:w</target_index>
17
    <target_index>Identifier-standard:w</target_index>
(-)a/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl (+3 lines)
Lines 51-56 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
51
    <z:index name="Local-number:n">
51
    <z:index name="Local-number:n">
52
      <xslo:value-of select="."/>
52
      <xslo:value-of select="."/>
53
    </z:index>
53
    </z:index>
54
    <z:index name="Local-number:s">
55
      <xslo:value-of select="."/>
56
    </z:index>
54
  </xslo:template>
57
  </xslo:template>
55
  <xslo:template match="marc:controlfield[@tag='009']">
58
  <xslo:template match="marc:controlfield[@tag='009']">
56
    <z:index name="Identifier-standard:w">
59
    <z:index name="Identifier-standard:w">
(-)a/installer/data/mysql/atomicupdate/bug_30327_add_sortComponents_syspref.pl (-2 / +2 lines)
Lines 7-14 return { Link Here
7
        my ($args) = @_;
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        $dbh->do(q{
9
        $dbh->do(q{
10
            INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
10
            INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
11
            ('ComponentSortField','title','call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'),
11
            ('ComponentSortField','title','call_number|pubdate|acqdate|title|author|biblionumber','Specify the default field used for sorting','Choice'),
12
            ('ComponentSortOrder','asc','asc|dsc|az|za','Specify the default sort order','Choice')
12
            ('ComponentSortOrder','asc','asc|dsc|az|za','Specify the default sort order','Choice')
13
        });
13
        });
14
        say $out "Added ComponentsSortField and ComponentsSortOrder sysprefs";
14
        say $out "Added ComponentsSortField and ComponentsSortOrder sysprefs";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-1 / +1 lines)
Lines 289-294 Cataloging: Link Here
289
                  acqdate: date added
289
                  acqdate: date added
290
                  title: title
290
                  title: title
291
                  author: author
291
                  author: author
292
                  biblionumber: biblionumber
292
            - ','
293
            - ','
293
            - pref: ComponentSortOrder
294
            - pref: ComponentSortOrder
294
              choices:
295
              choices:
295
- 

Return to bug 30879