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

(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (-21 / +102 lines)
Lines 477-492 sub _convert_sort_fields { Link Here
477
477
478
    # Turn the sorting into something we care about.
478
    # Turn the sorting into something we care about.
479
    my %sort_field_convert = (
479
    my %sort_field_convert = (
480
        acqdate     => 'acqdate',
480
        acqdate     => 'Date-of-acquisition',
481
        author      => 'author',
481
        author      => 'Author',
482
        call_number => 'callnum',
482
        call_number => 'Local-classification',
483
        popularity  => 'issues',
483
        popularity  => 'issues',
484
        relevance   => undef,       # default
484
        relevance   => undef,       # default
485
        title       => 'title',
485
        title       => 'Title',
486
        pubdate     => 'pubdate',
486
        pubdate     => 'Date-of-publication',
487
    );
488
    my %sort_order_convert = (
489
        dsc => 'desc',
490
        asc => 'asc',
491
        az => 'asc',
492
        za => 'desc',
487
    );
493
    );
488
    my %sort_order_convert =
489
      ( qw( dsc desc ), qw( asc asc ), qw( az asc ), qw( za desc ) );
490
494
491
    # Convert the fields and orders, drop anything we don't know about.
495
    # Convert the fields and orders, drop anything we don't know about.
492
    grep { $_->{field} } map {
496
    grep { $_->{field} } map {
Lines 513-532 types. Link Here
513
=cut
517
=cut
514
518
515
our %index_field_convert = (
519
our %index_field_convert = (
516
    'kw'      => '_all',
520
    'kw' => '_all',
517
    'ti'      => 'title',
521
    'ab' => 'Abstract',
518
    'au'      => 'author',
522
    'au' => 'Author',
519
    'su'      => 'subject',
523
    'lcn' => 'Local-classification',
520
    'nb'      => 'isbn',
524
    'callnum' => 'Local-classification',
521
    'se'      => 'title-series',
525
    'ln' => 'language',
522
    'callnum' => 'callnum',
526
    'Record-type' => 'rtype',
523
    'itype'   => 'itype',
527
    'mc-rtype' => 'rtype',
524
    'ln'      => 'ln',
528
    'mus' => 'rtype',
525
    'branch'  => 'homebranch',
529
    'ctype' => 'Content-type',
526
    'fic'     => 'lf',
530
    'lc-card' => 'LC-card-number',
527
    'mus'     => 'rtype',
531
    'sn' => 'Local-number',
528
    'aud'     => 'ta',
532
    'yr' => 'Date-of-publication',
529
    'hi'      => 'Host-Item-Number',
533
    'pubdate' => 'Date-of-publication',
534
    'acqdate' => 'Date-of-acquisition',
535
    'Date-time-last-modified' => 'Date/time-last-modified',
536
    'dtlm' => 'Date/time-last-modified',
537
    'diss' => 'Dissertation-information',
538
    'ean' => 'EAN',
539
    'nb' => 'ISBN',
540
    'isbn' => 'ISBN',
541
    'ns' => 'ISSN',
542
    'issn' => 'ISSN',
543
    'Music-number' => 'Identifier-publisher-for-music',
544
    'Number-music-publisher' => 'Identifier-publisher-for-music',
545
    'music' => 'Identifier-publisher-for-music',
546
    'ident' => 'Identifier-standard',
547
    'name' => 'Name',
548
    'cpn' => 'Corporate-name',
549
    'cfn' => 'Conference-name',
550
    'pl' => 'Place-publication',
551
    'pn' => 'Personal-name',
552
    'pb' => 'Publisher',
553
    'pv' => 'Provider',
554
    'nt' => 'Note',
555
    'notes' => 'Note',
556
    'rcn' => 'Record-control-number',
557
    'su' => 'Subject',
558
    'su-to' => 'Subject',
559
    #'su-geo' => 'Subject',
560
    'su-ut' => 'Subject',
561
    'ti' => 'Title',
562
    'se' => 'Title-series',
563
    'ut' => 'Title-uniform',
564
    'an' => 'Authority-Number',
565
    'Koha-Auth-Number' => 'Authority-Number',
566
    'at' => 'authtype',
567
    'he' => 'Heading',
568
    'rank' => 'relevance',
569
    'phr' => 'st-phrase',
570
    'wrdl' => 'st-word-list',
571
    'rt' => 'right-Truncation',
572
    'rtrn' => 'right-Truncation',
573
    'ltrn' => 'left-Truncation',
574
    'rltrn' => 'left-and-right',
575
    'mc-itemtype' => 'itemtype',
576
    'mc-ccode' => 'ccode',
577
    'branch' => 'homebranch',
578
    'mc-loc' => 'location',
579
    'stocknumber' => 'Number-local-acquisition',
580
    'inv' => 'Number-local-acquisition',
581
    'bc' => 'barcode',
582
    'mc-itype' => 'itype',
583
    'aub' => 'Author-personal-bibliography',
584
    'auo' => 'Author-in-order',
585
    'ff8-22' => 'ta',
586
    'aud' => 'ta',
587
    'audience' => 'ta',
588
    'Frequency-code' => 'ff8-18',
589
    'Illustration-code' => 'ff8-18-21',
590
    'Regularity-code' => 'ff8-19',
591
    'Type-Of-Serial' => 'ff8-21',
592
    'format' => 'ff8-23',
593
    'Conference-code' => 'ff8-29',
594
    'Festschrift-indicator' => 'ff8-30',
595
    'Index-indicator' => 'ff8-31',
596
    'fiction' => 'lf',
597
    'fic' => 'lf',
598
    'Literature-Code' => 'lf',
599
    'biography' => 'bio',
600
    'ff8-34' => 'bio',
601
    'Biography-Code' => 'bio',
602
    'l-format' => 'ff7-01-02',
603
    'lex' => 'lexile-number',
604
    'video-mt' => 'Video-mt',
605
    'Graphic-type' => 'Graphics-type',
606
    'Graphic-support' => 'Graphics-support',
607
    'item' => 'Item',
608
    'hi' => 'Host-Item-Number',
609
    'itu' => 'Index-term-uncontrolled',
610
    'itg' => 'Index-term-genre',
530
);
611
);
531
612
532
sub _convert_index_fields {
613
sub _convert_index_fields {
(-)a/admin/searchengine/elasticsearch/mappings.yaml (-74 / +41 lines)
Lines 159-164 authorities: Link Here
159
        marc_type: normarc
159
        marc_type: normarc
160
        sort: ~
160
        sort: ~
161
        suggestible: ''
161
        suggestible: ''
162
      - facet: ''
163
        marc_field: 995j
164
        marc_type: unimarc
165
        sort: ~
166
        suggestible: ''
162
    type: ''
167
    type: ''
163
  Local-number:
168
  Local-number:
164
    label: Local-number
169
    label: Local-number
Lines 577-584 biblios: Link Here
577
        sort: ~
582
        sort: ~
578
        suggestible: ''
583
        suggestible: ''
579
    type: string
584
    type: string
580
  acqdate:
585
  Date-of-acquisition:
581
    label: acqdate
586
    label: Date-of-acquisition
582
    mappings:
587
    mappings:
583
      - facet: ''
588
      - facet: ''
584
        marc_field: 952d
589
        marc_field: 952d
Lines 596-603 biblios: Link Here
596
        sort: ~
601
        sort: ~
597
        suggestible: ''
602
        suggestible: ''
598
    type: date
603
    type: date
599
  an:
604
  Authority-Number:
600
    label: an
605
    label: Authority-Number
601
    mappings:
606
    mappings:
602
      - facet: ''
607
      - facet: ''
603
        marc_field: '1009'
608
        marc_field: '1009'
Lines 1120-1127 biblios: Link Here
1120
        sort: ~
1125
        sort: ~
1121
        suggestible: ''
1126
        suggestible: ''
1122
    type: number
1127
    type: number
1123
  author:
1128
  Author:
1124
    label: author
1129
    label: Author
1125
    mappings:
1130
    mappings:
1126
      - facet: '1'
1131
      - facet: '1'
1127
        marc_field: 100a
1132
        marc_field: 100a
Lines 1141-1152 biblios: Link Here
1141
      - facet: 0
1146
      - facet: 0
1142
        marc_field: 245c
1147
        marc_field: 245c
1143
        marc_type: marc21
1148
        marc_type: marc21
1144
        sort: 0
1149
        sort: ~
1145
        suggestible: 0
1150
        suggestible: 0
1146
      - facet: 1
1151
      - facet: 1
1147
        marc_field: 700a
1152
        marc_field: 700a
1148
        marc_type: marc21
1153
        marc_type: marc21
1149
        sort: 0
1154
        sort: ~
1150
        suggestible: 1
1155
        suggestible: 1
1151
      - facet: '1'
1156
      - facet: '1'
1152
        marc_field: 100a
1157
        marc_field: 100a
Lines 1166-1177 biblios: Link Here
1166
      - facet: 0
1171
      - facet: 0
1167
        marc_field: 245c
1172
        marc_field: 245c
1168
        marc_type: normarc
1173
        marc_type: normarc
1169
        sort: 0
1174
        sort: ~
1170
        suggestible: 0
1175
        suggestible: 0
1171
      - facet: 1
1176
      - facet: 1
1172
        marc_field: 700a
1177
        marc_field: 700a
1173
        marc_type: normarc
1178
        marc_type: normarc
1174
        sort: 0
1179
        sort: ~
1175
        suggestible: 1
1180
        suggestible: 1
1176
      - facet: '1'
1181
      - facet: '1'
1177
        marc_field: 200f
1182
        marc_field: 200f
Lines 1186-1197 biblios: Link Here
1186
      - facet: 1
1191
      - facet: 1
1187
        marc_field: 700a
1192
        marc_field: 700a
1188
        marc_type: unimarc
1193
        marc_type: unimarc
1189
        sort: 0
1194
        sort: ~
1190
        suggestible: 1
1195
        suggestible: 1
1191
      - facet: 0
1196
      - facet: 0
1192
        marc_field: '701'
1197
        marc_field: '701'
1193
        marc_type: unimarc
1198
        marc_type: unimarc
1194
        sort: 0
1199
        sort: ~
1195
        suggestible: 0
1200
        suggestible: 0
1196
    type: string
1201
    type: string
1197
  bgf-number:
1202
  bgf-number:
Lines 1241-1260 biblios: Link Here
1241
        sort: ~
1246
        sort: ~
1242
        suggestible: ''
1247
        suggestible: ''
1243
    type: ''
1248
    type: ''
1244
  bnb-card-number:
1245
    label: bnb-card-number
1246
    mappings:
1247
      - facet: ''
1248
        marc_field: '015'
1249
        marc_type: marc21
1250
        sort: ~
1251
        suggestible: ''
1252
      - facet: ''
1253
        marc_field: '015'
1254
        marc_type: normarc
1255
        sort: ~
1256
        suggestible: ''
1257
    type: ''
1258
  ccode:
1249
  ccode:
1259
    label: collection-code
1250
    label: collection-code
1260
    mappings:
1251
    mappings:
Lines 1274-1281 biblios: Link Here
1274
       sort: ~
1265
       sort: ~
1275
       suggestible: ''
1266
       suggestible: ''
1276
    type: ''
1267
    type: ''
1277
  control-number:
1268
  Control-number:
1278
    label: control-number
1269
    label: Control-number
1279
    mappings:
1270
    mappings:
1280
      - facet: ''
1271
      - facet: ''
1281
        marc_field: '001'
1272
        marc_field: '001'
Lines 1481-1488 biblios: Link Here
1481
        sort: ~
1472
        sort: ~
1482
        suggestible: ''
1473
        suggestible: ''
1483
    type: string
1474
    type: string
1484
  identifier-standard:
1475
  Identifier-standard:
1485
    label: identifier-standard
1476
    label: Identifier-standard
1486
    mappings:
1477
    mappings:
1487
      - facet: ''
1478
      - facet: ''
1488
        marc_field: '010'
1479
        marc_field: '010'
Lines 1550-1557 biblios: Link Here
1550
        sort: ~
1541
        sort: ~
1551
        suggestible: ''
1542
        suggestible: ''
1552
    type: ''
1543
    type: ''
1553
  isbn:
1544
  ISBN:
1554
    label: isbn
1545
    label: ISBN
1555
    mappings:
1546
    mappings:
1556
      - facet: ''
1547
      - facet: ''
1557
        marc_field: 020a
1548
        marc_field: 020a
Lines 1655-1684 biblios: Link Here
1655
        sort: ~
1646
        sort: ~
1656
        suggestible: ''
1647
        suggestible: ''
1657
    type: string
1648
    type: string
1658
  lc-cardnumber:
1659
    label: lc-cardnumber
1660
    mappings:
1661
      - facet: ''
1662
        marc_field: '010'
1663
        marc_type: marc21
1664
        sort: ~
1665
        suggestible: ''
1666
      - facet: ''
1667
        marc_field: '011'
1668
        marc_type: marc21
1669
        sort: ~
1670
        suggestible: ''
1671
      - facet: ''
1672
        marc_field: '010'
1673
        marc_type: normarc
1674
        sort: ~
1675
        suggestible: ''
1676
      - facet: ''
1677
        marc_field: 995j
1678
        marc_type: unimarc
1679
        sort: ~
1680
        suggestible: ''
1681
    type: ''
1682
  lf:
1649
  lf:
1683
    label: lf
1650
    label: lf
1684
    mappings:
1651
    mappings:
Lines 1712-1719 biblios: Link Here
1712
        sort: ~
1679
        sort: ~
1713
        suggestible: ''
1680
        suggestible: ''
1714
    type: ''
1681
    type: ''
1715
  ln:
1682
  language:
1716
    label: ln
1683
    label: language
1717
    mappings:
1684
    mappings:
1718
      - facet: ''
1685
      - facet: ''
1719
        marc_field: 008_/35-37
1686
        marc_field: 008_/35-37
Lines 1731-1738 biblios: Link Here
1731
        sort: ~
1698
        sort: ~
1732
        suggestible: ''
1699
        suggestible: ''
1733
    type: ''
1700
    type: ''
1734
  local-classification:
1701
  Local-classification:
1735
    label: local-classification
1702
    label: Local-classification
1736
    mappings:
1703
    mappings:
1737
      - facet: ''
1704
      - facet: ''
1738
        marc_field: 952o
1705
        marc_field: 952o
Lines 1877-1884 biblios: Link Here
1877
        sort: ~
1844
        sort: ~
1878
        suggestible: ''
1845
        suggestible: ''
1879
    type: boolean
1846
    type: boolean
1880
  pl:
1847
  Place-publication:
1881
    label: pl
1848
    label: Place-publication
1882
    mappings:
1849
    mappings:
1883
      - facet: ''
1850
      - facet: ''
1884
        marc_field: 008_/15-17
1851
        marc_field: 008_/15-17
Lines 1891-1898 biblios: Link Here
1891
        sort: ~
1858
        sort: ~
1892
        suggestible: ''
1859
        suggestible: ''
1893
    type: ''
1860
    type: ''
1894
  place:
1861
  Place-of-publication:
1895
    label: place
1862
    label: Place-of-publication
1896
    mappings:
1863
    mappings:
1897
      - facet: '1'
1864
      - facet: '1'
1898
        marc_field: 260a
1865
        marc_field: 260a
Lines 1910-1917 biblios: Link Here
1910
        sort: ~
1877
        sort: ~
1911
        suggestible: ''
1878
        suggestible: ''
1912
    type: string
1879
    type: string
1913
  pubdate:
1880
  Date-of-publication:
1914
    label: pubdate
1881
    label: Date-of-publication
1915
    mappings:
1882
    mappings:
1916
      - facet: ''
1883
      - facet: ''
1917
        marc_field: 008_/7-10
1884
        marc_field: 008_/7-10
Lines 1929-1936 biblios: Link Here
1929
        sort: ~
1896
        sort: ~
1930
        suggestible: ''
1897
        suggestible: ''
1931
    type: ''
1898
    type: ''
1932
  publisher:
1899
  Publisher:
1933
    label: publisher
1900
    label: Publisher
1934
    mappings:
1901
    mappings:
1935
      - facet: '1'
1902
      - facet: '1'
1936
        marc_field: 260b
1903
        marc_field: 260b
Lines 1976-1983 biblios: Link Here
1976
        sort: ~
1943
        sort: ~
1977
        suggestible: ''
1944
        suggestible: ''
1978
    type: ''
1945
    type: ''
1979
  se:
1946
  Title-series:
1980
    label: se
1947
    label: Title-series
1981
    mappings:
1948
    mappings:
1982
      - facet: '1'
1949
      - facet: '1'
1983
        marc_field: 440a
1950
        marc_field: 440a
Lines 2024-2031 biblios: Link Here
2024
        sort: ~
1991
        sort: ~
2025
        suggestible: ''
1992
        suggestible: ''
2026
    type: string
1993
    type: string
2027
  subject:
1994
  Subject:
2028
    label: subject
1995
    label: Subject
2029
    mappings:
1996
    mappings:
2030
      - facet: '1'
1997
      - facet: '1'
2031
        marc_field: 600a
1998
        marc_field: 600a
Lines 2286-2293 biblios: Link Here
2286
        sort: ~
2253
        sort: ~
2287
        suggestible: ''
2254
        suggestible: ''
2288
    type: ''
2255
    type: ''
2289
  title:
2256
  Title:
2290
    label: title
2257
    label: Title
2291
    mappings:
2258
    mappings:
2292
      - facet: ''
2259
      - facet: ''
2293
        marc_field: '130'
2260
        marc_field: '130'
(-)a/installer/data/mysql/atomicupdate/bug_19575-use-canonical-field-names-and-resolve-aliased-fields.sql (-1 / +17 lines)
Line 0 Link Here
0
- 
1
UPDATE `search_field` SET `name` = 'Date-of-publication', `label` = 'Date-of-publication' WHERE `name` = 'pubdate';
2
UPDATE `search_field` SET `name` = 'Title-series', `label` = 'Title-series' WHERE `name` = 'se';
3
UPDATE `search_field` SET `name` = 'Identifier-standard', `label` = 'Identifier-standard' WHERE `name` = 'identifier-standard';
4
UPDATE `search_field` SET `name` = 'Author', `label` = 'Author' WHERE `name` = 'author';
5
UPDATE `search_field` SET `name` = 'Control-number', `label` = 'Control-number' WHERE `name` = 'control-number';
6
UPDATE `search_field` SET `name` = 'Place-publication', `label` = 'Place-publication' WHERE `name` = 'pl';
7
UPDATE `search_field` SET `name` = 'Date-of-acquisition', `label` = 'Date-of-acquisition' WHERE `name` = 'acqdate';
8
UPDATE `search_field` SET `name` = 'ISBN', `label` = 'ISBN' WHERE `name` = 'isbn';
9
UPDATE `search_field` SET `name` = 'BNB-card-number', `label` = 'BNB-card-number' WHERE `name` = 'bnb-card-number';
10
UPDATE `search_field` SET `name` = 'Authority-Number', `label` = 'Authority-Number' WHERE `name` = 'an';
11
UPDATE `search_field` SET `name` = 'language', `label` = 'language' WHERE `name` = 'ln';
12
UPDATE `search_field` SET `name` = 'Subject', `label` = 'Subject' WHERE `name` = 'subject';
13
UPDATE `search_field` SET `name` = 'Publisher', `label` = 'Publisher' WHERE `name` = 'publisher';
14
DELETE FROM `search_field` WHERE `name` = 'lc-cardnumber';
15
DELETE FROM `search_field` WHERE `name` = 'bnb-card-number';
16
UPDATE `search_field` SET `name` = 'Title', `label` = 'Title' WHERE `name` = 'title';
17
UPDATE `search_field` SET `name` = 'Local-classification', `label` = 'Local-classification' WHERE `name` = 'local-classification';

Return to bug 19575