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

(-)a/Koha/SearchEngine/Elasticsearch.pm (+2 lines)
Lines 209-214 sub get_elasticsearch_mappings { Link Here
209
                    $es_type = 'stdno';
209
                    $es_type = 'stdno';
210
                } elsif ($type eq 'year') {
210
                } elsif ($type eq 'year') {
211
                    $es_type = 'year';
211
                    $es_type = 'year';
212
                } elsif ($type eq 'callnumber') {
213
                    $es_type = 'cn_sort';
212
                }
214
                }
213
215
214
                if ($search) {
216
                if ($search) {
(-)a/admin/searchengine/elasticsearch/field_config.yaml (+4 lines)
Lines 71-73 sort: Link Here
71
    type: icu_collation_keyword
71
    type: icu_collation_keyword
72
    index: false
72
    index: false
73
    numeric: true
73
    numeric: true
74
  cn_sort:
75
    type: icu_collation_keyword
76
    index: false
77
    numeric: false
(-)a/admin/searchengine/elasticsearch/mappings.yaml (-1 / +1 lines)
Lines 1167-1173 biblios: Link Here
1167
        marc_type: marc21
1167
        marc_type: marc21
1168
        sort: 1
1168
        sort: 1
1169
        suggestible: ''
1169
        suggestible: ''
1170
    type: ''
1170
    type: 'callnumber'
1171
  cn-suffix:
1171
  cn-suffix:
1172
    label: cn-suffix
1172
    label: cn-suffix
1173
    mappings:
1173
    mappings:
(-)a/installer/data/mysql/atomicupdate/bug_29632.pl (+15 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "29632    ",
5
    description => "Add callnumber type to allow sorting",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        $dbh->do(q{
10
            ALTER TABLE `search_field` MODIFY COLUMN `type`
11
            enum('','string','date','number','boolean','sum','isbn','stdno','year','callnumber') NOT NULL
12
        });
13
        say $out "Add callnumber to search_field type enum";
14
    },
15
};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt (-1 / +5 lines)
Lines 219-224 a.add, a.delete { Link Here
219
                                    [% ELSE %]
219
                                    [% ELSE %]
220
                                        <option value="stdno">Std. Number</option>
220
                                        <option value="stdno">Std. Number</option>
221
                                    [% END %]
221
                                    [% END %]
222
                                    [% IF search_field.type == "callnumber" %]
223
                                        <option value="callnumber" selected="selected">Call Number</option>
224
                                    [% ELSE %]
225
                                        <option value="callnumber">Call Number</option>
226
                                    [% END %]
222
                                    </select>
227
                                    </select>
223
                            </td>
228
                            </td>
224
                                <td data-order="[% search_field.weight | html %]">
229
                                <td data-order="[% search_field.weight | html %]">
225
- 

Return to bug 29632