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 658-663 field_mappings: Link Here
658
      bib1_mapping:
658
      bib1_mapping:
659
        biblioserver:
659
        biblioserver:
660
          1: 9
660
          1: 9
661
        authorityserver:
662
          1: LC-card-number
661
      enabled: 1
663
      enabled: 1
662
      index: lc-card-number
664
      index: lc-card-number
663
      aliases:
665
      aliases:
Lines 834-839 field_mappings: Link Here
834
      aliases:
836
      aliases:
835
        - popularity
837
        - popularity
836
      label: Popularity
838
      label: Popularity
839
    previous-only:
840
      bib1_mapping:
841
        authorityserver:
842
          1: Previous-heading-see-from
843
      enabled: 1
844
      index: previous-only
845
      aliases:
846
        - prev-see-from
847
      label: Previous-heading-see-from
837
    price:
848
    price:
838
      bib1_mapping:
849
      bib1_mapping:
839
        biblioserver:
850
        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 1122-1129 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
1122
      <xslo:value-of select="normalize-space($raw_heading)"/>
1122
      <xslo:value-of select="normalize-space($raw_heading)"/>
1123
    </z:index>
1123
    </z:index>
1124
  </xslo:template>
1124
  </xslo:template>
1125
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='400']">
1126
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'">
1127
      <z:index name="Previous-heading-see-from:p">
1128
        <xslo:variable name="raw_heading">
1129
          <xslo:for-each select="marc:subfield">
1130
            <xslo:if test="contains('abcdefghjklmnopqrstvxyz', @code)" name="Previous-heading-see-from:p">
1131
              <xslo:if test="position() &gt; 1">
1132
                <xslo:choose>
1133
                  <xslo:when test="contains('vxyz', @code)">
1134
                    <xslo:text>--</xslo:text>
1135
                  </xslo:when>
1136
                  <xslo:otherwise>
1137
                    <xslo:value-of select="substring(' ', 1, 1)"/>
1138
                  </xslo:otherwise>
1139
                </xslo:choose>
1140
              </xslo:if>
1141
              <xslo:value-of select="."/>
1142
            </xslo:if>
1143
          </xslo:for-each>
1144
        </xslo:variable>
1145
        <xslo:value-of select="normalize-space($raw_heading)"/>
1146
      </z:index>
1147
    </xslo:if>
1148
  </xslo:template>
1149
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='410']">
1150
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'">
1151
      <z:index name="Previous-heading-see-from:p">
1152
        <xslo:variable name="raw_heading">
1153
          <xslo:for-each select="marc:subfield">
1154
            <xslo:if test="contains('abcdefghklmnoprstvxyz', @code)" name="Previous-heading-see-from:p">
1155
              <xslo:if test="position() &gt; 1">
1156
                <xslo:choose>
1157
                  <xslo:when test="contains('vxyz', @code)">
1158
                    <xslo:text>--</xslo:text>
1159
                  </xslo:when>
1160
                  <xslo:otherwise>
1161
                    <xslo:value-of select="substring(' ', 1, 1)"/>
1162
                  </xslo:otherwise>
1163
                </xslo:choose>
1164
              </xslo:if>
1165
              <xslo:value-of select="."/>
1166
            </xslo:if>
1167
          </xslo:for-each>
1168
        </xslo:variable>
1169
        <xslo:value-of select="normalize-space($raw_heading)"/>
1170
      </z:index>
1171
    </xslo:if>
1172
  </xslo:template>
1173
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='411']">
1174
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'">
1175
      <z:index name="Previous-heading-see-from:p">
1176
        <xslo:variable name="raw_heading">
1177
          <xslo:for-each select="marc:subfield">
1178
            <xslo:if test="contains('acdefghjklnpqstvxyz', @code)" name="Previous-heading-see-from:p">
1179
              <xslo:if test="position() &gt; 1">
1180
                <xslo:choose>
1181
                  <xslo:when test="contains('vxyz', @code)">
1182
                    <xslo:text>--</xslo:text>
1183
                  </xslo:when>
1184
                  <xslo:otherwise>
1185
                    <xslo:value-of select="substring(' ', 1, 1)"/>
1186
                  </xslo:otherwise>
1187
                </xslo:choose>
1188
              </xslo:if>
1189
              <xslo:value-of select="."/>
1190
            </xslo:if>
1191
          </xslo:for-each>
1192
        </xslo:variable>
1193
        <xslo:value-of select="normalize-space($raw_heading)"/>
1194
      </z:index>
1195
    </xslo:if>
1196
  </xslo:template>
1197
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='430']">
1198
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'">
1199
      <z:index name="Previous-heading-see-from:p">
1200
        <xslo:variable name="raw_heading">
1201
          <xslo:for-each select="marc:subfield">
1202
            <xslo:if test="contains('adfghklmnoprstvxyz', @code)" name="Previous-heading-see-from:p">
1203
              <xslo:if test="position() &gt; 1">
1204
                <xslo:choose>
1205
                  <xslo:when test="contains('vxyz', @code)">
1206
                    <xslo:text>--</xslo:text>
1207
                  </xslo:when>
1208
                  <xslo:otherwise>
1209
                    <xslo:value-of select="substring(' ', 1, 1)"/>
1210
                  </xslo:otherwise>
1211
                </xslo:choose>
1212
              </xslo:if>
1213
              <xslo:value-of select="."/>
1214
            </xslo:if>
1215
          </xslo:for-each>
1216
        </xslo:variable>
1217
        <xslo:value-of select="normalize-space($raw_heading)"/>
1218
      </z:index>
1219
    </xslo:if>
1220
  </xslo:template>
1221
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='448']">
1222
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'">
1223
      <z:index name="Previous-heading-see-from:p">
1224
        <xslo:variable name="raw_heading">
1225
          <xslo:for-each select="marc:subfield">
1226
            <xslo:if test="contains('avxyz', @code)" name="Previous-heading-see-from:p">
1227
              <xslo:if test="position() &gt; 1">
1228
                <xslo:choose>
1229
                  <xslo:when test="contains('vxyz', @code)">
1230
                    <xslo:text>--</xslo:text>
1231
                  </xslo:when>
1232
                  <xslo:otherwise>
1233
                    <xslo:value-of select="substring(' ', 1, 1)"/>
1234
                  </xslo:otherwise>
1235
                </xslo:choose>
1236
              </xslo:if>
1237
              <xslo:value-of select="."/>
1238
            </xslo:if>
1239
          </xslo:for-each>
1240
        </xslo:variable>
1241
        <xslo:value-of select="normalize-space($raw_heading)"/>
1242
      </z:index>
1243
    </xslo:if>
1244
  </xslo:template>
1125
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='450']">
1245
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='450']">
1126
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 2, 1)">
1246
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'">
1127
      <z:index name="Previous-heading-see-from:p">
1247
      <z:index name="Previous-heading-see-from:p">
1128
        <xslo:variable name="raw_heading">
1248
        <xslo:variable name="raw_heading">
1129
          <xslo:for-each select="marc:subfield">
1249
          <xslo:for-each select="marc:subfield">
Lines 1146-1151 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
1146
      </z:index>
1266
      </z:index>
1147
    </xslo:if>
1267
    </xslo:if>
1148
  </xslo:template>
1268
  </xslo:template>
1269
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='451']">
1270
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'">
1271
      <z:index name="Previous-heading-see-from:p">
1272
        <xslo:variable name="raw_heading">
1273
          <xslo:for-each select="marc:subfield">
1274
            <xslo:if test="contains('avxyz', @code)" name="Previous-heading-see-from:p">
1275
              <xslo:if test="position() &gt; 1">
1276
                <xslo:choose>
1277
                  <xslo:when test="contains('vxyz', @code)">
1278
                    <xslo:text>--</xslo:text>
1279
                  </xslo:when>
1280
                  <xslo:otherwise>
1281
                    <xslo:value-of select="substring(' ', 1, 1)"/>
1282
                  </xslo:otherwise>
1283
                </xslo:choose>
1284
              </xslo:if>
1285
              <xslo:value-of select="."/>
1286
            </xslo:if>
1287
          </xslo:for-each>
1288
        </xslo:variable>
1289
        <xslo:value-of select="normalize-space($raw_heading)"/>
1290
      </z:index>
1291
    </xslo:if>
1292
  </xslo:template>
1293
  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='455']">
1294
    <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'">
1295
      <z:index name="Previous-heading-see-from:p">
1296
        <xslo:variable name="raw_heading">
1297
          <xslo:for-each select="marc:subfield">
1298
            <xslo:if test="contains('avxyz', @code)" name="Previous-heading-see-from:p">
1299
              <xslo:if test="position() &gt; 1">
1300
                <xslo:choose>
1301
                  <xslo:when test="contains('vxyz', @code)">
1302
                    <xslo:text>--</xslo:text>
1303
                  </xslo:when>
1304
                  <xslo:otherwise>
1305
                    <xslo:value-of select="substring(' ', 1, 1)"/>
1306
                  </xslo:otherwise>
1307
                </xslo:choose>
1308
              </xslo:if>
1309
              <xslo:value-of select="."/>
1310
            </xslo:if>
1311
          </xslo:for-each>
1312
        </xslo:variable>
1313
        <xslo:value-of select="normalize-space($raw_heading)"/>
1314
      </z:index>
1315
    </xslo:if>
1316
  </xslo:template>
1149
  <xslo:template mode="index_match_heading" match="marc:datafield[@tag='100']">
1317
  <xslo:template mode="index_match_heading" match="marc:datafield[@tag='100']">
1150
    <z:index name="Match:w Match:p Match-heading:p Match-heading:s">
1318
    <z:index name="Match:w Match:p Match-heading:p Match-heading:s">
1151
      <xslo:variable name="raw_heading">
1319
      <xslo:variable name="raw_heading">
1152
- 

Return to bug 7419