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

(-)a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml (+2 lines)
Lines 1328-1333 Link Here
1328
    <target_index>Note:p</target_index>
1328
    <target_index>Note:p</target_index>
1329
  </index_subfields>
1329
  </index_subfields>
1330
1330
1331
  <onloan_field tag="952" subfield="q"/>
1332
1331
  <facet tag="100" subfields="a">
1333
  <facet tag="100" subfields="a">
1332
    <target_index>au:0</target_index>
1334
    <target_index>au:0</target_index>
1333
  </facet>
1335
  </facet>
(-)a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl (+6 lines)
Lines 44-49 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
44
      <xslo:apply-templates mode="index_subject_thesaurus"/>
44
      <xslo:apply-templates mode="index_subject_thesaurus"/>
45
      <xslo:apply-templates mode="index_all"/>
45
      <xslo:apply-templates mode="index_all"/>
46
      <xslo:apply-templates mode="index_sort_tit"/>
46
      <xslo:apply-templates mode="index_sort_tit"/>
47
      <xslo:call-template name="index_available"/>
47
    </z:record>
48
    </z:record>
48
  </xslo:template>
49
  </xslo:template>
49
  <xslo:template match="marc:leader">
50
  <xslo:template match="marc:leader">
Lines 2521-2526 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
2521
      </z:index>
2522
      </z:index>
2522
    </xslo:if>
2523
    </xslo:if>
2523
  </xslo:template>
2524
  </xslo:template>
2525
  <xslo:template name="index_available">
2526
    <z:index name="available:n">
2527
      <xslo:value-of select="count(marc:datafield[@tag='952']/marc:subfield[@code='q' and not(contains(.,'1'))])"/>
2528
    </z:index>
2529
  </xslo:template>
2524
  <xslo:template mode="index_all" match="text()">
2530
  <xslo:template mode="index_all" match="text()">
2525
    <z:index name="Any:w Any:p">
2531
    <z:index name="Any:w Any:p">
2526
      <xslo:value-of select="."/>
2532
      <xslo:value-of select="."/>
(-)a/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml (+2 lines)
Lines 969-974 Link Here
969
    <target_index>itype:w</target_index>
969
    <target_index>itype:w</target_index>
970
  </index_subfields>
970
  </index_subfields>
971
971
972
  <onloan_field tag="952" subfield="q"/>
973
972
  <facet tag="100" subfields="a">
974
  <facet tag="100" subfields="a">
973
    <target_index>au:0</target_index>
975
    <target_index>au:0</target_index>
974
  </facet>
976
  </facet>
(-)a/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl (+6 lines)
Lines 44-49 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
44
      <xslo:apply-templates mode="index_subject_thesaurus"/>
44
      <xslo:apply-templates mode="index_subject_thesaurus"/>
45
      <xslo:apply-templates mode="index_all"/>
45
      <xslo:apply-templates mode="index_all"/>
46
      <xslo:apply-templates mode="index_sort_tit"/>
46
      <xslo:apply-templates mode="index_sort_tit"/>
47
      <xslo:call-template name="index_available"/>
47
    </z:record>
48
    </z:record>
48
  </xslo:template>
49
  </xslo:template>
49
  <xslo:template match="marc:leader">
50
  <xslo:template match="marc:leader">
Lines 1861-1866 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
1861
      </z:index>
1862
      </z:index>
1862
    </xslo:if>
1863
    </xslo:if>
1863
  </xslo:template>
1864
  </xslo:template>
1865
  <xslo:template name="index_available">
1866
    <z:index name="available:n">
1867
      <xslo:value-of select="count(marc:datafield[@tag='952']/marc:subfield[@code='q' and not(contains(.,'1'))])"/>
1868
    </z:index>
1869
  </xslo:template>
1864
  <xslo:template mode="index_all" match="text()">
1870
  <xslo:template mode="index_all" match="text()">
1865
    <z:index name="Any:w Any:p">
1871
    <z:index name="Any:w Any:p">
1866
      <xslo:value-of select="."/>
1872
      <xslo:value-of select="."/>
(-)a/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml (+2 lines)
Lines 1444-1449 Link Here
1444
    <target_index>totalissues:s</target_index>
1444
    <target_index>totalissues:s</target_index>
1445
  </index_subfields>
1445
  </index_subfields>
1446
1446
1447
  <onloan_field tag="995" subfield="n"/>
1448
1447
  <facet tag="225" subfields="a">
1449
  <facet tag="225" subfields="a">
1448
    <target_index>se:0</target_index>
1450
    <target_index>se:0</target_index>
1449
  </facet>
1451
  </facet>
(-)a/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl (+21 lines)
Lines 17-22 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
17
  <xslo:template match="text()" mode="index_heading_conditional"/>
17
  <xslo:template match="text()" mode="index_heading_conditional"/>
18
  <xslo:template match="text()" mode="index_match_heading"/>
18
  <xslo:template match="text()" mode="index_match_heading"/>
19
  <xslo:template match="text()" mode="index_subject_thesaurus"/>
19
  <xslo:template match="text()" mode="index_subject_thesaurus"/>
20
  <xslo:template match="text()" mode="index_sort_tit"/>
20
  <xslo:template match="/">
21
  <xslo:template match="/">
21
    <xslo:if test="marc:collection">
22
    <xslo:if test="marc:collection">
22
      <collection>
23
      <collection>
Lines 42-47 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
42
      <xslo:apply-templates mode="index_match_heading"/>
43
      <xslo:apply-templates mode="index_match_heading"/>
43
      <xslo:apply-templates mode="index_subject_thesaurus"/>
44
      <xslo:apply-templates mode="index_subject_thesaurus"/>
44
      <xslo:apply-templates mode="index_all"/>
45
      <xslo:apply-templates mode="index_all"/>
46
      <xslo:apply-templates mode="index_sort_tit"/>
47
      <xslo:call-template name="index_available"/>
45
    </z:record>
48
    </z:record>
46
  </xslo:template>
49
  </xslo:template>
47
  <xslo:template match="marc:controlfield[@tag='001']">
50
  <xslo:template match="marc:controlfield[@tag='001']">
Lines 2676-2686 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
2676
      </z:index>
2679
      </z:index>
2677
    </xslo:if>
2680
    </xslo:if>
2678
  </xslo:template>
2681
  </xslo:template>
2682
  <xslo:template name="index_available">
2683
    <z:index name="available:n">
2684
      <xslo:value-of select="count(marc:datafield[@tag='995']/marc:subfield[@code='n' and not(contains(.,'1'))])"/>
2685
    </z:index>
2686
  </xslo:template>
2679
  <xslo:template mode="index_all" match="text()">
2687
  <xslo:template mode="index_all" match="text()">
2680
    <z:index name="Any:w Any:p">
2688
    <z:index name="Any:w Any:p">
2681
      <xslo:value-of select="."/>
2689
      <xslo:value-of select="."/>
2682
    </z:index>
2690
    </z:index>
2683
  </xslo:template>
2691
  </xslo:template>
2692
  <xslo:template mode="index_sort_tit" match="marc:datafield[@tag='245']">
2693
    <xslo:variable name="chop">
2694
      <xslo:choose>
2695
        <xslo:when test="not(number(@ind2))">0</xslo:when>
2696
        <xslo:otherwise>
2697
          <xslo:value-of select="number(@ind2)"/>
2698
        </xslo:otherwise>
2699
      </xslo:choose>
2700
    </xslo:variable>
2701
    <z:index name="Title:s">
2702
      <xslo:value-of select="substring(marc:subfield[@code='a'], $chop+1)"/>
2703
    </z:index>
2704
  </xslo:template>
2684
  <xslo:template name="chopPunctuation">
2705
  <xslo:template name="chopPunctuation">
2685
    <xslo:param name="chopString"/>
2706
    <xslo:param name="chopString"/>
2686
    <xslo:variable name="length" select="string-length($chopString)"/>
2707
    <xslo:variable name="length" select="string-length($chopString)"/>
(-)a/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl (-1 / +20 lines)
Lines 67-72 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
67
                    <xslo:apply-templates mode="index_subject_thesaurus"/>
67
                    <xslo:apply-templates mode="index_subject_thesaurus"/>
68
                    <xslo:apply-templates mode="index_all"/>
68
                    <xslo:apply-templates mode="index_all"/>
69
                    <xslo:apply-templates mode="index_sort_tit"/>
69
                    <xslo:apply-templates mode="index_sort_tit"/>
70
                    <xslo:call-template name="index_available"/>
70
                </z:record>
71
                </z:record>
71
            </xslo:template>
72
            </xslo:template>
72
73
Lines 78-83 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
78
            <xsl:call-template name="handle-index-heading"/>
79
            <xsl:call-template name="handle-index-heading"/>
79
            <xsl:call-template name="handle-index-heading-conditional"/>
80
            <xsl:call-template name="handle-index-heading-conditional"/>
80
            <xsl:call-template name="handle-index-match-heading"/>
81
            <xsl:call-template name="handle-index-match-heading"/>
82
            <xsl:call-template name="handle-availability-index"/>
81
            <xsl:apply-templates/>
83
            <xsl:apply-templates/>
82
            <xslo:template mode="index_all" match="text()">
84
            <xslo:template mode="index_all" match="text()">
83
                <z:index name="Any:w Any:p">
85
                <z:index name="Any:w Any:p">
Lines 379-384 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
379
        </xsl:for-each>
381
        </xsl:for-each>
380
    </xsl:template>
382
    </xsl:template>
381
383
384
    <xsl:template name="handle-availability-index">
385
        <xsl:for-each select="//kohaidx:onloan_field">
386
          <xslo:template name="index_available">
387
            <z:index name="available:n">
388
              <xslo:value-of>
389
                <xsl:attribute name="select">
390
                    <xsl:text>count(marc:datafield[@tag='</xsl:text>
391
                    <xsl:value-of select="@tag"/>
392
                    <xsl:text>']/marc:subfield[@code='</xsl:text>
393
                    <xsl:value-of select="@subfield"/>
394
                    <xsl:text>' and not(contains(.,'1'))])</xsl:text>
395
                </xsl:attribute>
396
              </xslo:value-of>
397
            </z:index>
398
          </xslo:template>
399
        </xsl:for-each>
400
    </xsl:template>
401
382
    <xsl:template name="handle-one-data-field">
402
    <xsl:template name="handle-one-data-field">
383
        <xsl:variable name="indexes">
403
        <xsl:variable name="indexes">
384
            <xsl:call-template name="get-target-indexes"/>
404
            <xsl:call-template name="get-target-indexes"/>
385
- 

Return to bug 18098