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

(-)a/C4/AuthoritiesMarc.pm (+3 lines)
Lines 161-166 sub SearchAuthorities { Link Here
161
                elsif ( @$tags[$i] eq "thesaurus" ) {
161
                elsif ( @$tags[$i] eq "thesaurus" ) {
162
                    $attr = " \@attr 1=Subject-heading-thesaurus ";
162
                    $attr = " \@attr 1=Subject-heading-thesaurus ";
163
                }
163
                }
164
                elsif ( @$tags[$i] eq "previous-only" ) {
165
                    $attr = " \@attr 1=Previous-heading-see-from ";
166
                }
164
                else {    # Assume any if no index was specified
167
                else {    # Assume any if no index was specified
165
                    $attr = " \@attr 1=Any ";
168
                    $attr = " \@attr 1=Any ";
166
                }
169
                }
(-)a/etc/searchengine/queryparser.yaml (+11 lines)
Lines 785-790 field_mappings: Link Here
785
      bib1_mapping:
785
      bib1_mapping:
786
        biblioserver:
786
        biblioserver:
787
          1: 9
787
          1: 9
788
        authorityserver:
789
          1: LC-card-number
788
      enabled: 1
790
      enabled: 1
789
      index: lc-card-number
791
      index: lc-card-number
790
      aliases:
792
      aliases:
Lines 961-966 field_mappings: Link Here
961
      aliases:
963
      aliases:
962
        - popularity
964
        - popularity
963
      label: Popularity
965
      label: Popularity
966
    previous-only:
967
      bib1_mapping:
968
        authorityserver:
969
          1: Previous-heading-see-from
970
      enabled: 1
971
      index: previous-only
972
      aliases:
973
        - prev-see-from
974
      label: Previous-heading-see-from
964
    price:
975
    price:
965
      bib1_mapping:
976
      bib1_mapping:
966
        biblioserver:
977
        biblioserver:
(-)a/etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml (-4 / +24 lines)
Lines 60-66 authority-zebra-indexdefs.xsl` Link Here
60
    <kohaidx:target_index>Record-source:p</kohaidx:target_index>
60
    <kohaidx:target_index>Record-source:p</kohaidx:target_index>
61
  </kohaidx:index_subfields>
61
  </kohaidx:index_subfields>
62
62
63
  
64
  <!-- Personal name headings -->
63
  <!-- Personal name headings -->
65
  <kohaidx:index_subfields tag="100" subfields="abcdefghjklmnopqrstvxyz">
64
  <kohaidx:index_subfields tag="100" subfields="abcdefghjklmnopqrstvxyz">
66
    <kohaidx:target_index>Personal-name:w</kohaidx:target_index>
65
    <kohaidx:target_index>Personal-name:w</kohaidx:target_index>
Lines 101-106 authority-zebra-indexdefs.xsl` Link Here
101
    <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index>
100
    <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index>
102
    <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index>
101
    <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index>
103
  </kohaidx:index_match_heading>
102
  </kohaidx:index_match_heading>
103
  <kohaidx:index_heading_conditional tag="400" test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'" subfields="abcdefghjklmnopqrstvxyz" subdivisions="vxyz">
104
    <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index>
105
  </kohaidx:index_heading_conditional>
104
  
106
  
105
  <kohaidx:index_heading tag="500" subfields="abcdefghjklmnopqrstvxyz" subdivisions="vxyz">
107
  <kohaidx:index_heading tag="500" subfields="abcdefghjklmnopqrstvxyz" subdivisions="vxyz">
106
    <kohaidx:target_index>Personal-name-see-also-from:w</kohaidx:target_index>
108
    <kohaidx:target_index>Personal-name-see-also-from:w</kohaidx:target_index>
Lines 154-159 authority-zebra-indexdefs.xsl` Link Here
154
    <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index>
156
    <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index>
155
    <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index>
157
    <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index>
156
  </kohaidx:index_match_heading>
158
  </kohaidx:index_match_heading>
159
  <kohaidx:index_heading_conditional tag="410" test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'" subfields="abcdefghklmnoprstvxyz" subdivisions="vxyz">
160
    <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index>
161
  </kohaidx:index_heading_conditional>
157
  
162
  
158
  <kohaidx:index_heading tag="510" subfields="abcdefghklmnoprstvxyz" subdivisions="vxyz">
163
  <kohaidx:index_heading tag="510" subfields="abcdefghklmnoprstvxyz" subdivisions="vxyz">
159
    <kohaidx:target_index>Corporate-name-see-also-from:w</kohaidx:target_index>
164
    <kohaidx:target_index>Corporate-name-see-also-from:w</kohaidx:target_index>
Lines 207-212 authority-zebra-indexdefs.xsl` Link Here
207
    <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index>
212
    <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index>
208
    <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index>
213
    <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index>
209
  </kohaidx:index_match_heading>
214
  </kohaidx:index_match_heading>
215
  <kohaidx:index_heading_conditional tag="411" test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'" subfields="acdefghjklnpqstvxyz" subdivisions="vxyz">
216
    <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index>
217
  </kohaidx:index_heading_conditional>
210
  
218
  
211
  <kohaidx:index_heading tag="511" subfields="acdefghjklnpqstvxyz" subdivisions="vxyz">
219
  <kohaidx:index_heading tag="511" subfields="acdefghjklnpqstvxyz" subdivisions="vxyz">
212
    <kohaidx:target_index>Meeting-name-see-also-from:w</kohaidx:target_index>
220
    <kohaidx:target_index>Meeting-name-see-also-from:w</kohaidx:target_index>
Lines 260-265 authority-zebra-indexdefs.xsl` Link Here
260
    <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index>
268
    <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index>
261
    <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index>
269
    <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index>
262
  </kohaidx:index_match_heading>
270
  </kohaidx:index_match_heading>
271
  <kohaidx:index_heading_conditional tag="430" test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'" subfields="adfghklmnoprstvxyz" subdivisions="vxyz">
272
    <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index>
273
  </kohaidx:index_heading_conditional>
263
  
274
  
264
  <kohaidx:index_heading tag="530" subfields="adfghklmnoprstvxyz" subdivisions="vxyz">
275
  <kohaidx:index_heading tag="530" subfields="adfghklmnoprstvxyz" subdivisions="vxyz">
265
    <kohaidx:target_index>Title-uniform-see-also-from:w</kohaidx:target_index>
276
    <kohaidx:target_index>Title-uniform-see-also-from:w</kohaidx:target_index>
Lines 313-318 authority-zebra-indexdefs.xsl` Link Here
313
    <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index>
324
    <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index>
314
    <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index>
325
    <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index>
315
  </kohaidx:index_match_heading>
326
  </kohaidx:index_match_heading>
327
  <kohaidx:index_heading_conditional tag="448" test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'" subfields="avxyz" subdivisions="vxyz">
328
    <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index>
329
  </kohaidx:index_heading_conditional>
316
  
330
  
317
  <kohaidx:index_heading tag="548" subfields="avxyz" subdivisions="vxyz">
331
  <kohaidx:index_heading tag="548" subfields="avxyz" subdivisions="vxyz">
318
    <kohaidx:target_index>Chronological-term-see-also-from:w</kohaidx:target_index>
332
    <kohaidx:target_index>Chronological-term-see-also-from:w</kohaidx:target_index>
Lines 361-375 authority-zebra-indexdefs.xsl` Link Here
361
    <kohaidx:target_index>See-from:p</kohaidx:target_index>
375
    <kohaidx:target_index>See-from:p</kohaidx:target_index>
362
    <kohaidx:target_index>See-from:s</kohaidx:target_index>
376
    <kohaidx:target_index>See-from:s</kohaidx:target_index>
363
  </kohaidx:index_heading>
377
  </kohaidx:index_heading>
364
  <kohaidx:index_heading_conditional tag="450" test="substring(marc:subfield[@code='w']/text(), 2, 1)" subfields="abvxyz" subdivisions="vxyz">
365
    <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index>
366
  </kohaidx:index_heading_conditional>
367
  <kohaidx:index_match_heading tag="450" subfields="abvxyz" subdivisions="vxyz">
378
  <kohaidx:index_match_heading tag="450" subfields="abvxyz" subdivisions="vxyz">
368
    <kohaidx:target_index>Match:w</kohaidx:target_index>
379
    <kohaidx:target_index>Match:w</kohaidx:target_index>
369
    <kohaidx:target_index>Match:p</kohaidx:target_index>
380
    <kohaidx:target_index>Match:p</kohaidx:target_index>
370
    <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index>
381
    <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index>
371
    <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index>
382
    <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index>
372
  </kohaidx:index_match_heading>
383
  </kohaidx:index_match_heading>
384
  <kohaidx:index_heading_conditional tag="450" test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'" subfields="abvxyz" subdivisions="vxyz">
385
    <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index>
386
  </kohaidx:index_heading_conditional>
373
  
387
  
374
  <kohaidx:index_heading tag="550" subfields="abvxyz" subdivisions="vxyz">
388
  <kohaidx:index_heading tag="550" subfields="abvxyz" subdivisions="vxyz">
375
    <kohaidx:target_index>Subject-topical-see-also-from:w</kohaidx:target_index>
389
    <kohaidx:target_index>Subject-topical-see-also-from:w</kohaidx:target_index>
Lines 423-428 authority-zebra-indexdefs.xsl` Link Here
423
    <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index>
437
    <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index>
424
    <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index>
438
    <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index>
425
  </kohaidx:index_match_heading>
439
  </kohaidx:index_match_heading>
440
  <kohaidx:index_heading_conditional tag="451" test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'" subfields="avxyz" subdivisions="vxyz">
441
    <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index>
442
  </kohaidx:index_heading_conditional>
426
  
443
  
427
  <kohaidx:index_heading tag="551" subfields="avxyz" subdivisions="vxyz">
444
  <kohaidx:index_heading tag="551" subfields="avxyz" subdivisions="vxyz">
428
    <kohaidx:target_index>Name-geographic-see-also-from:w</kohaidx:target_index>
445
    <kohaidx:target_index>Name-geographic-see-also-from:w</kohaidx:target_index>
Lines 476-481 authority-zebra-indexdefs.xsl` Link Here
476
    <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index>
493
    <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index>
477
    <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index>
494
    <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index>
478
  </kohaidx:index_match_heading>
495
  </kohaidx:index_match_heading>
496
  <kohaidx:index_heading_conditional tag="455" test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'" subfields="avxyz" subdivisions="vxyz">
497
    <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index>
498
  </kohaidx:index_heading_conditional>
479
  
499
  
480
  <kohaidx:index_heading tag="555" subfields="avxyz" subdivisions="vxyz">
500
  <kohaidx:index_heading tag="555" subfields="avxyz" subdivisions="vxyz">
481
    <kohaidx:target_index>Term-genre-form-see-also-from:w</kohaidx:target_index>
501
    <kohaidx:target_index>Term-genre-form-see-also-from:w</kohaidx:target_index>
(-)a/etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl (-2 / +169 lines)
Lines 1123-1130 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
1123
      <xslo:value-of select="normalize-space($raw_heading)"/>
1123
      <xslo:value-of select="normalize-space($raw_heading)"/>
1124
    </z:index>
1124
    </z:index>
1125
  </xslo:template>
1125
  </xslo:template>
1126
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='400']">
1127
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'">
1128
      <z:index name="Previous-heading-see-from:p">
1129
        <xslo:variable name="raw_heading">
1130
          <xslo:for-each select="marc:subfield">
1131
            <xslo:if test="contains('abcdefghjklmnopqrstvxyz', @code)" name="Previous-heading-see-from:p">
1132
              <xslo:if test="position() &gt; 1">
1133
                <xslo:choose>
1134
                  <xslo:when test="contains('vxyz', @code)">
1135
                    <xslo:text>--</xslo:text>
1136
                  </xslo:when>
1137
                  <xslo:otherwise>
1138
                    <xslo:value-of select="substring(' ', 1, 1)"/>
1139
                  </xslo:otherwise>
1140
                </xslo:choose>
1141
              </xslo:if>
1142
              <xslo:value-of select="."/>
1143
            </xslo:if>
1144
          </xslo:for-each>
1145
        </xslo:variable>
1146
        <xslo:value-of select="normalize-space($raw_heading)"/>
1147
      </z:index>
1148
    </xslo:if>
1149
  </xslo:template>
1150
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='410']">
1151
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'">
1152
      <z:index name="Previous-heading-see-from:p">
1153
        <xslo:variable name="raw_heading">
1154
          <xslo:for-each select="marc:subfield">
1155
            <xslo:if test="contains('abcdefghklmnoprstvxyz', @code)" name="Previous-heading-see-from:p">
1156
              <xslo:if test="position() &gt; 1">
1157
                <xslo:choose>
1158
                  <xslo:when test="contains('vxyz', @code)">
1159
                    <xslo:text>--</xslo:text>
1160
                  </xslo:when>
1161
                  <xslo:otherwise>
1162
                    <xslo:value-of select="substring(' ', 1, 1)"/>
1163
                  </xslo:otherwise>
1164
                </xslo:choose>
1165
              </xslo:if>
1166
              <xslo:value-of select="."/>
1167
            </xslo:if>
1168
          </xslo:for-each>
1169
        </xslo:variable>
1170
        <xslo:value-of select="normalize-space($raw_heading)"/>
1171
      </z:index>
1172
    </xslo:if>
1173
  </xslo:template>
1174
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='411']">
1175
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'">
1176
      <z:index name="Previous-heading-see-from:p">
1177
        <xslo:variable name="raw_heading">
1178
          <xslo:for-each select="marc:subfield">
1179
            <xslo:if test="contains('acdefghjklnpqstvxyz', @code)" name="Previous-heading-see-from:p">
1180
              <xslo:if test="position() &gt; 1">
1181
                <xslo:choose>
1182
                  <xslo:when test="contains('vxyz', @code)">
1183
                    <xslo:text>--</xslo:text>
1184
                  </xslo:when>
1185
                  <xslo:otherwise>
1186
                    <xslo:value-of select="substring(' ', 1, 1)"/>
1187
                  </xslo:otherwise>
1188
                </xslo:choose>
1189
              </xslo:if>
1190
              <xslo:value-of select="."/>
1191
            </xslo:if>
1192
          </xslo:for-each>
1193
        </xslo:variable>
1194
        <xslo:value-of select="normalize-space($raw_heading)"/>
1195
      </z:index>
1196
    </xslo:if>
1197
  </xslo:template>
1198
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='430']">
1199
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'">
1200
      <z:index name="Previous-heading-see-from:p">
1201
        <xslo:variable name="raw_heading">
1202
          <xslo:for-each select="marc:subfield">
1203
            <xslo:if test="contains('adfghklmnoprstvxyz', @code)" name="Previous-heading-see-from:p">
1204
              <xslo:if test="position() &gt; 1">
1205
                <xslo:choose>
1206
                  <xslo:when test="contains('vxyz', @code)">
1207
                    <xslo:text>--</xslo:text>
1208
                  </xslo:when>
1209
                  <xslo:otherwise>
1210
                    <xslo:value-of select="substring(' ', 1, 1)"/>
1211
                  </xslo:otherwise>
1212
                </xslo:choose>
1213
              </xslo:if>
1214
              <xslo:value-of select="."/>
1215
            </xslo:if>
1216
          </xslo:for-each>
1217
        </xslo:variable>
1218
        <xslo:value-of select="normalize-space($raw_heading)"/>
1219
      </z:index>
1220
    </xslo:if>
1221
  </xslo:template>
1222
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='448']">
1223
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'">
1224
      <z:index name="Previous-heading-see-from:p">
1225
        <xslo:variable name="raw_heading">
1226
          <xslo:for-each select="marc:subfield">
1227
            <xslo:if test="contains('avxyz', @code)" name="Previous-heading-see-from:p">
1228
              <xslo:if test="position() &gt; 1">
1229
                <xslo:choose>
1230
                  <xslo:when test="contains('vxyz', @code)">
1231
                    <xslo:text>--</xslo:text>
1232
                  </xslo:when>
1233
                  <xslo:otherwise>
1234
                    <xslo:value-of select="substring(' ', 1, 1)"/>
1235
                  </xslo:otherwise>
1236
                </xslo:choose>
1237
              </xslo:if>
1238
              <xslo:value-of select="."/>
1239
            </xslo:if>
1240
          </xslo:for-each>
1241
        </xslo:variable>
1242
        <xslo:value-of select="normalize-space($raw_heading)"/>
1243
      </z:index>
1244
    </xslo:if>
1245
  </xslo:template>
1126
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='450']">
1246
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='450']">
1127
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 2, 1)">
1247
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'">
1128
      <z:index name="Previous-heading-see-from:p">
1248
      <z:index name="Previous-heading-see-from:p">
1129
        <xslo:variable name="raw_heading">
1249
        <xslo:variable name="raw_heading">
1130
          <xslo:for-each select="marc:subfield">
1250
          <xslo:for-each select="marc:subfield">
Lines 1147-1152 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
1147
      </z:index>
1267
      </z:index>
1148
    </xslo:if>
1268
    </xslo:if>
1149
  </xslo:template>
1269
  </xslo:template>
1270
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='451']">
1271
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'">
1272
      <z:index name="Previous-heading-see-from:p">
1273
        <xslo:variable name="raw_heading">
1274
          <xslo:for-each select="marc:subfield">
1275
            <xslo:if test="contains('avxyz', @code)" name="Previous-heading-see-from:p">
1276
              <xslo:if test="position() &gt; 1">
1277
                <xslo:choose>
1278
                  <xslo:when test="contains('vxyz', @code)">
1279
                    <xslo:text>--</xslo:text>
1280
                  </xslo:when>
1281
                  <xslo:otherwise>
1282
                    <xslo:value-of select="substring(' ', 1, 1)"/>
1283
                  </xslo:otherwise>
1284
                </xslo:choose>
1285
              </xslo:if>
1286
              <xslo:value-of select="."/>
1287
            </xslo:if>
1288
          </xslo:for-each>
1289
        </xslo:variable>
1290
        <xslo:value-of select="normalize-space($raw_heading)"/>
1291
      </z:index>
1292
    </xslo:if>
1293
  </xslo:template>
1294
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='455']">
1295
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'">
1296
      <z:index name="Previous-heading-see-from:p">
1297
        <xslo:variable name="raw_heading">
1298
          <xslo:for-each select="marc:subfield">
1299
            <xslo:if test="contains('avxyz', @code)" name="Previous-heading-see-from:p">
1300
              <xslo:if test="position() &gt; 1">
1301
                <xslo:choose>
1302
                  <xslo:when test="contains('vxyz', @code)">
1303
                    <xslo:text>--</xslo:text>
1304
                  </xslo:when>
1305
                  <xslo:otherwise>
1306
                    <xslo:value-of select="substring(' ', 1, 1)"/>
1307
                  </xslo:otherwise>
1308
                </xslo:choose>
1309
              </xslo:if>
1310
              <xslo:value-of select="."/>
1311
            </xslo:if>
1312
          </xslo:for-each>
1313
        </xslo:variable>
1314
        <xslo:value-of select="normalize-space($raw_heading)"/>
1315
      </z:index>
1316
    </xslo:if>
1317
  </xslo:template>
1150
  <xslo:template mode="index_match_heading" match="marc:datafield[@tag='100']">
1318
  <xslo:template mode="index_match_heading" match="marc:datafield[@tag='100']">
1151
    <z:index name="Match:w Match:p Match-heading:p Match-heading:s">
1319
    <z:index name="Match:w Match:p Match-heading:p Match-heading:s">
1152
      <xslo:variable name="raw_heading">
1320
      <xslo:variable name="raw_heading">
1153
- 

Return to bug 7419