Bug 9828 : Followup for Queryparser and deletion of useless 6XX$9
authorMathieu Saby <mathsabypro@gmail.com>
Wed, 20 Aug 2014 14:24:49 +0000 (16:24 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 27 Oct 2014 15:46:47 +0000 (12:46 -0300)
This followup
- changes some indexes in Queryparser configuration file
- supresses some clearly useless 6XX$9 in biblio-koha-indexdefs.xml and adds 2 new ones, probably useless (not sure of that)
- change the name of index Subject-geographical to Subject-name-geographical in ccl.properties (to match bib1.att)
the xsl file zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl was generated with the following command:
xsltproc zebradb/xsl/koha-indexdefs-to-zebra.xsl zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml > zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl

To test :
1) Apply the 3 patches
2) copy the modified files from the source directory to the directory where you store the config files for Zebra and Queryparser
The files modified by the 3 patches and that need to be copied are:
etc/zebradb/biblios/etc/bib1.att
etc/zebradb/ccl.properties
etc/searchengine/queryparser.yaml
etc/zebradb/ccl.properties
.../unimarc/biblios/biblio-koha-indexdefs.xml
.../unimarc/biblios/biblio-zebra-indexdefs.xsl
3) Rebuild Zebra
4) Create a record A with some values in critical fields, for example:
- the string "test9828" in 600$c 600$f 600$p, 602$f, 616$c, 616$f, 606$2,600$2
- the string "subform" in 600$j
4) Create a record B with the string "subgeo" in 606$y
5) Create a record C with the string "subdate" in 606$z
WITHOUT QP activated in sysprefs ("Don't try to use QP"):
6) try to search "su:test9828". You should have no results
7) try to search "su-genre:subform". You should have 1 result : record A
8) try to search "su-geo:subgeo". You should have 1 result : record B
9) try to search "su-chrono:subdate". You should have 1 result : record C
10) on existing records, try su-ut, su-to, su-na, su-form, su-corp, su-geo indexes, and see it results are relevant
WITH QP activated in sysprefs:
Same tests

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

etc/searchengine/queryparser.yaml
etc/zebradb/ccl.properties
etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml
etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl

index d9f637b..717df1e 100644 (file)
@@ -1196,9 +1196,7 @@ field_mappings:
       label: ''
       aliases:
         - su
-        - su-to
-        - su-geo
-        - su-ut
+    authority-number:
     authority-number:
       bib1_mapping:
         biblioserver:
@@ -1270,16 +1268,6 @@ field_mappings:
       aliases:
         - matchheading
         - match-heading
-    name-personal:
-      bib1_mapping:
-        biblioserver:
-          1: 1009
-      enabled: 1
-      index: name-personal
-      label: Name-personal
-      aliases:
-        - name-personal
-        - su-na
     index-term-genre:
       bib1_mapping:
         biblioserver:
@@ -1321,6 +1309,97 @@ field_mappings:
       label: Start
       aliases:
         - start
+    subject-chronological:
+      bib1_mapping:
+        biblioserver:
+          1: 1077
+      enabled: 1
+      index: subject-chronological
+      label: Subject-chronological
+      aliases:
+        - subject-chronological
+        - su-chrono
+    subject-division:
+      bib1_mapping:
+        biblioserver:
+          1: 47
+      enabled: 1
+      index: subject-division
+      label: Subject-division
+      aliases:
+        - subject-division
+    subject-genre-form:
+      bib1_mapping:
+        biblioserver:
+          1: 1075
+      enabled: 1
+      index: subject-genre-form
+      label: Subject-genre-form
+      aliases:
+        - subject-genre-form
+        - su-genre
+        - su-form
+    subject-name-conference:
+      bib1_mapping:
+        biblioserver:
+          1: 1073
+      enabled: 1
+      index: subject-name-conference
+      label: Subject-name-conference
+      aliases:
+        - subject-name-conference
+        - su-conf
+    subject-name-corporate:
+      bib1_mapping:
+        biblioserver:
+          1: 1074
+      enabled: 1
+      index: subject-name-corporate
+      label: Subject-name-corporate
+      aliases:
+        - subject-name-corporate
+        - su-corp
+    subject-name-geographical:
+      bib1_mapping:
+        biblioserver:
+          1: 1076
+      enabled: 1
+      index: subject-name-geographical
+      label: Subject-name-geographical
+      aliases:
+        - subject-name-geographical
+        - su-geo
+    subject-name-personal:
+      bib1_mapping:
+        biblioserver:
+          1: 1009
+      enabled: 1
+      index: subject-name-personal
+      label: Subject-name-personal
+      aliases:
+        - subject-name-personal
+        - su-na
+    subject-title:
+      bib1_mapping:
+        biblioserver:
+          1: 1078
+      enabled: 1
+      index: subject-title
+      label: Subject-title
+      aliases:
+        - subject-title
+        - su-ti
+        - su-ut
+    subject-topical:
+      bib1_mapping:
+        biblioserver:
+          1: 1079
+      enabled: 1
+      index: subject-topical
+      label: Subject-topical
+      aliases:
+        - subject-topical
+        - su-to
   title:
     title:
       bib1_mapping:
index 85611d3..f0c0934 100644 (file)
@@ -739,10 +739,10 @@ Subject-genre-form 1=1075
 su-genre Subject-genre-form
 su-form Subject-genre-form
 
-#Subject-geographical 1076                                 MARC21 651 ; UNIMARC 607
+#Subject-name-geographical 1076                            MARC21 651 ; UNIMARC 607
 #                                                          MARC21 AND UNIMARC 6XX$y
-Subject-geographical 1=1076
-su-geo Subject-geographical
+Subject-name-geographical 1=1076
+su-geo Subject-name-geographical
 
 #Subject-chronological 1077                                MARC21 and UNIMARC 6XX$z
 Subject-chronological 1=1077
index 85f50f8..55462c1 100644 (file)
     <target_index>Koha-Auth-Number:w</target_index>
     <target_index>Koha-Auth-Number:n</target_index>
   </index_subfields>
-  <!--603$9      Koha-Auth-Number,Koha-Auth-Number:n-->
-  <index_subfields tag="603" subfields="9">
+  <!--660$9      Koha-Auth-Number,Koha-Auth-Number:n-->
+  <index_subfields tag="660" subfields="9">
     <target_index>Koha-Auth-Number:w</target_index>
     <target_index>Koha-Auth-Number:n</target_index>
   </index_subfields>
-  <!--630$9      Koha-Auth-Number,Koha-Auth-Number:n-->
-  <index_subfields tag="630" subfields="9">
-    <target_index>Koha-Auth-Number:w</target_index>
-    <target_index>Koha-Auth-Number:n</target_index>
-  </index_subfields>
-  <!--631$9      Koha-Auth-Number,Koha-Auth-Number:n-->
-  <index_subfields tag="631" subfields="9">
-    <target_index>Koha-Auth-Number:w</target_index>
-    <target_index>Koha-Auth-Number:n</target_index>
-  </index_subfields>
-  <!--632$9      Koha-Auth-Number,Koha-Auth-Number:n-->
-  <index_subfields tag="632" subfields="9">
-    <target_index>Koha-Auth-Number:w</target_index>
-    <target_index>Koha-Auth-Number:n</target_index>
-  </index_subfields>
-  <!--633$9      Koha-Auth-Number,Koha-Auth-Number:n-->
-  <index_subfields tag="633" subfields="9">
-    <target_index>Koha-Auth-Number:w</target_index>
-    <target_index>Koha-Auth-Number:n</target_index>
-  </index_subfields>
-  <!--634$9      Koha-Auth-Number,Koha-Auth-Number:n-->
-  <index_subfields tag="634" subfields="9">
-    <target_index>Koha-Auth-Number:w</target_index>
-    <target_index>Koha-Auth-Number:n</target_index>
-  </index_subfields>
-  <!--635$9      Koha-Auth-Number,Koha-Auth-Number:n-->
-  <index_subfields tag="635" subfields="9">
-    <target_index>Koha-Auth-Number:w</target_index>
-    <target_index>Koha-Auth-Number:n</target_index>
-  </index_subfields>
-  <!--636$9      Koha-Auth-Number,Koha-Auth-Number:n-->
-  <index_subfields tag="636" subfields="9">
+  <!--661$9      Koha-Auth-Number,Koha-Auth-Number:n-->
+  <index_subfields tag="661" subfields="9">
     <target_index>Koha-Auth-Number:w</target_index>
     <target_index>Koha-Auth-Number:n</target_index>
   </index_subfields>
index ef2ff9e..9de15be 100644 (file)
@@ -2138,52 +2138,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
       </xslo:if>
     </xslo:for-each>
   </xslo:template>
-  <xslo:template mode="index_subfields" match="marc:datafield[@tag='603']">
-    <xslo:for-each select="marc:subfield">
-      <xslo:if test="contains('9', @code)">
-        <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
-          <xslo:value-of select="."/>
-        </z:index>
-      </xslo:if>
-    </xslo:for-each>
-  </xslo:template>
-  <xslo:template mode="index_subfields" match="marc:datafield[@tag='630']">
-    <xslo:for-each select="marc:subfield">
-      <xslo:if test="contains('9', @code)">
-        <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
-          <xslo:value-of select="."/>
-        </z:index>
-      </xslo:if>
-    </xslo:for-each>
-  </xslo:template>
-  <xslo:template mode="index_subfields" match="marc:datafield[@tag='631']">
-    <xslo:for-each select="marc:subfield">
-      <xslo:if test="contains('9', @code)">
-        <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
-          <xslo:value-of select="."/>
-        </z:index>
-      </xslo:if>
-    </xslo:for-each>
-  </xslo:template>
-  <xslo:template mode="index_subfields" match="marc:datafield[@tag='632']">
-    <xslo:for-each select="marc:subfield">
-      <xslo:if test="contains('9', @code)">
-        <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
-          <xslo:value-of select="."/>
-        </z:index>
-      </xslo:if>
-    </xslo:for-each>
-  </xslo:template>
-  <xslo:template mode="index_subfields" match="marc:datafield[@tag='633']">
-    <xslo:for-each select="marc:subfield">
-      <xslo:if test="contains('9', @code)">
-        <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
-          <xslo:value-of select="."/>
-        </z:index>
-      </xslo:if>
-    </xslo:for-each>
-  </xslo:template>
-  <xslo:template mode="index_subfields" match="marc:datafield[@tag='634']">
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='660']">
     <xslo:for-each select="marc:subfield">
       <xslo:if test="contains('9', @code)">
         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
@@ -2191,17 +2146,15 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
         </z:index>
       </xslo:if>
     </xslo:for-each>
-  </xslo:template>
-  <xslo:template mode="index_subfields" match="marc:datafield[@tag='635']">
     <xslo:for-each select="marc:subfield">
-      <xslo:if test="contains('9', @code)">
-        <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="Subject:w Subject:p">
           <xslo:value-of select="."/>
         </z:index>
       </xslo:if>
     </xslo:for-each>
   </xslo:template>
-  <xslo:template mode="index_subfields" match="marc:datafield[@tag='636']">
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='661']">
     <xslo:for-each select="marc:subfield">
       <xslo:if test="contains('9', @code)">
         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
@@ -2209,17 +2162,6 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
         </z:index>
       </xslo:if>
     </xslo:for-each>
-  </xslo:template>
-  <xslo:template mode="index_subfields" match="marc:datafield[@tag='660']">
-    <xslo:for-each select="marc:subfield">
-      <xslo:if test="contains('a', @code)">
-        <z:index name="Subject:w Subject:p">
-          <xslo:value-of select="."/>
-        </z:index>
-      </xslo:if>
-    </xslo:for-each>
-  </xslo:template>
-  <xslo:template mode="index_subfields" match="marc:datafield[@tag='661']">
     <xslo:for-each select="marc:subfield">
       <xslo:if test="contains('a', @code)">
         <z:index name="Subject:w Subject:p">