Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/pazpar2
authorDennis Schafroth <dennis@indexdata.com>
Mon, 21 May 2012 11:27:27 +0000 (11:27 +0000)
committerDennis Schafroth <dennis@indexdata.com>
Mon, 21 May 2012 11:27:27 +0000 (11:27 +0000)
Conflicts:
test/test_limit_limitmap.urls

47 files changed:
IDMETA
NEWS
doc/pazpar2_conf.xml
etc/.gitignore
etc/server.xml
etc/services/long_sessions.xml
etc/services/perf.xml
etc/services/perf_opac_turbo.xml
etc/services/perf_turbo.xml
etc/services/solr.xml
etc/settings/edu_opac_turbo.xml [new file with mode: 0644]
js/pz2.js
nmen.stat [new file with mode: 0644]
src/client.c
src/http_command.c
src/normalize_record.c
src/pazpar2_config.c
src/session.c
src/settings.c
src/settings.h
src/termlists.c
test/Makefile.am
test/test_facets.cfg
test/test_filter.cfg
test/test_icu.cfg
test/test_icu_8.res
test/test_limit_limitmap.cfg
test/test_limit_limitmap.urls
test/test_limit_limitmap_24.res
test/test_limit_limitmap_4.xml
test/test_limit_limitmap_settings_3.xml
test/test_limit_limitmap_settings_4.xml
test/test_post.urls
test/test_solr.cfg
test/test_solr.urls
test/test_solr_22.res
test/test_solr_23.res [new file with mode: 0644]
test/test_solr_24.res [new file with mode: 0644]
test/test_solr_25.res [new file with mode: 0644]
test/test_solr_26.res [new file with mode: 0644]
test/test_solr_27.res [new file with mode: 0644]
test/test_solr_28.res [new file with mode: 0644]
test/test_solr_29.res [new file with mode: 0644]
test/test_solr_settings_4.xml
test/test_solr_settings_5.xml [new file with mode: 0644]
test/test_termlist_block.cfg
test/z3950_indexdata_com_marc.xml

diff --git a/IDMETA b/IDMETA
index 19913f7..a255755 100644 (file)
--- a/IDMETA
+++ b/IDMETA
@@ -1,3 +1,3 @@
 DEBIAN_DIST="wheezy squeeze"
-UBUNTU_DIST="oneiric natty maverick lucid"
+UBUNTU_DIST="precise oneiric natty lucid"
 VERSION=1.6.12
diff --git a/NEWS b/NEWS
index 16bb77d..0d7f4ca 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,23 @@
+Setting pz:xslt may embed local XSLT as an alternative to referring
+to filenames.
+Value is not CDATA but XML nodes embedded, so escaping is not necessary
+but a root element *must* be present. For example:
+<settings target="target="z3950.indexdata.com/marc">
+     <set name="pz:xslt">
+       <xsl:stylesheet
+          version="1.0"
+        ..
+       </xsl:stylesheet>
+     </set>
+    </settings>
+
+Metadata field rank may given by XML internal document (pz:xslt
+result). If rank is not given, the rank from service description is
+used - as before.
+
+New setting, pz:present_chunk, that specifies number of records to fetch
+at a time.
+
 --- 1.6.12 2012/03/14
 
 Revert the format change in termlist response, that could break 
index bea66c2..6eb2032 100644 (file)
          </varlistentry>
          
          <varlistentry>
+          <term id="metadata_limitmap">limitmap</term>
+          <listitem>
+           <para>
+            Specifies a default limitmap for this field. This is to avoid mass 
+            configuring of targets. However it is important to review/do this on a per
+            target since it is usually target-specific. See limitmap for format. 
+           </para>
+          </listitem>
+         </varlistentry>
+         
+         <varlistentry>
+          <term id="metadata_facetmap">facetmap</term>
+          <listitem>
+           <para>
+            Specifies a default facetmap for this field. This is to avoid mass 
+            configuring of targets. However it is important to review/do this on a per
+            target since it is usually target-specific. See facetmap for format. 
+           </para>
+          </listitem>
+         </varlistentry>
+         
+         <varlistentry>
           <term>setting</term>
           <listitem>
            <para>
        </varlistentry>
        
        <varlistentry>
+       <term>set</term>
+       <listitem>
+        <para>
+         Specifies a variable that will be inherited by all targets defined in settings
+         <screen>
+          &lt;set name="test" value="en"..&lt;set>
+         </screen>
+        </para>
+       </listitem>
+       </varlistentry>
+       
+       <varlistentry>
        <term>settings</term>
        <listitem>
         <para>
              type="year" merge="range" termlist="yes"/>
    <metadata name="author" brief="yes" termlist="yes"
              merge="longest" rank="2"/>
-   <metadata name="subject" merge="unique" termlist="yes" rank="3"/>
+   <metadata name="subject" merge="unique" termlist="yes" rank="3" limitmap="local:"/>
    <metadata name="url" merge="unique"/>
    <icu_chain id="relevance" locale="el">
     <transform rule="[:Control:] Any-Remove"/>
index 23669ea..029d31b 100644 (file)
@@ -1,2 +1,3 @@
 pazpar2.cfg
 pz22usi.xsl
+services-enabled
\ No newline at end of file
index d47a663..f2c404c 100644 (file)
       <casemap rule="l"/>
     </icu_chain>
 
+    <!-- default rule if not facetrule is defined on meta-data element -->
     <icu_chain id="facet" locale="en">
-      <display/>
-      <transform rule="Title"/>
+      <transliterate>[[:WhiteSpace:][,.-]]* } [$] > ;</transliterate>
     </icu_chain>
     
+    <!-- Specific facet rule -->
+    <icu_chain id="facet-subject" locale="en">
+      <transliterate>[[:WhiteSpace:][,.-]]* } [$] > ;</transliterate>
+    </icu_chain>
+
     <include src="services-enabled/*.xml"/>
 
   </server>
index 175e8da..046e816 100644 (file)
     <set name="pz:piggyback" value="1" />
 
     <!-- field-specific mappings -->
-    <set name="pz:cclmap:au" value="u=1004 s=al"/>
-    <set name="pz:cclmap:ti" value="u=4 s=al"/>
-    <set name="pz:cclmap:su" value="u=21 s=al"/>
-    <set name="pz:cclmap:isbn" value="u=7"/>
-    <set name="pz:cclmap:issn" value="u=8"/>
-    <set name="pz:cclmap:date" value="u=30 r=r"/>
+    <set name="pz:cclmap:au"       value="u=1004 s=al"/>
+    <set name="pz:cclmap:au_exact" value="u=1004 s=al 6=3 "/>
+    <set name="pz:cclmap:ti"       value="u=4 s=al"/>
+    <set name="pz:cclmap:su"       value="u=21 s=al"/>
+    <set name="pz:cclmap:su_exact" value="u=21 s=al 6=3"/>
+    <set name="pz:cclmap:isbn"     value="u=7"/>
+    <set name="pz:cclmap:issn"     value="u=8"/>
+    <set name="pz:cclmap:date"     value="u=30 r=r"/>
 
     <!-- Retrieval settings -->
 
@@ -75,8 +77,9 @@
   <metadata name="isbn"/>
   <metadata name="issn"/>
   <metadata name="tech-rep-nr"/>
+  <!-- Use the cclmap for author. Can be improved with a completeness. Needs to be overriden for SRU/Solr targets -->
   <metadata name="author" brief="yes" termlist="yes" merge="unique" 
-           rank="2" mergekey="optional"/>
+           rank="2" mergekey="optional" facetrule="facet-author" limitmap="ccl:au_exact" />
   <metadata name="author-title"/>
   <metadata name="author-date"/>
   <metadata name="corporate-name"/>
@@ -94,7 +97,7 @@
   <metadata name="title-dates" brief="yes" merge="longest"/>
   <metadata name="title-medium" brief="yes" merge="longest"/>
   <metadata name="title-number-section" brief="yes" merge="longest"/>
-  <metadata name="medium" brief="yes" merge="no" mergekey="optional"/>
+  <metadata name="medium" brief="yes" merge="no" mergekey="optional" limitmap="local:" />
   <metadata name="iii-id" brief="yes" merge="no"/>
   <metadata name="edition"/>
   <metadata name="publication-place"/>
   <metadata name="series-title"/>
   
   <metadata name="description" brief="yes" merge="unique" rank="3"/>
+  <!-- Use the cclmap for subject. Can be improved with a completeness. Needs to be overriden for SRU/Solr targets -->
+  <metadata name="subject" termlist="yes" rank="0" facetrule="facet-subject" limitmap="ccl:su_exact" />
   <metadata name="subject-long" rank="3"/>
-  <metadata name="subject" termlist="yes" rank="0"/>
   <metadata name="snippet" brief="yes" merge="unique"/>
   <metadata name="electronic-url" brief="yes" merge="no"/>
   <metadata name="electronic-format-type" />
index 90bae4c..afdde2c 100644 (file)
     <set name="pz:piggyback" value="0" />
 
     <!-- field-specific mappings -->
-    <set name="pz:cclmap:au" value="u=1004 s=al"/>
-    <set name="pz:cclmap:ti" value="u=4 s=al"/>
-    <set name="pz:cclmap:su" value="u=21 s=al"/>
-    <set name="pz:cclmap:isbn" value="u=7"/>
-    <set name="pz:cclmap:issn" value="u=8"/>
-    <set name="pz:cclmap:date" value="u=30 r=r"/>
+    <set name="pz:cclmap:au"       value="u=1004 s=al"/>
+    <set name="pz:cclmap:au_exact" value="u=1004 s=al 6=3 "/>
+    <set name="pz:cclmap:ti"       value="u=4 s=al"/>
+    <set name="pz:cclmap:su"       value="u=21 s=al"/>
+    <set name="pz:cclmap:su_exact" value="u=21 s=al 6=3"/>
+    <set name="pz:cclmap:isbn"     value="u=7"/>
+    <set name="pz:cclmap:issn"     value="u=8"/>
+    <set name="pz:cclmap:date"     value="u=30 r=r"/>
 
     <!-- Retrieval settings -->
 
@@ -76,8 +78,9 @@
   <metadata name="isbn"/>
   <metadata name="issn"/>
   <metadata name="tech-rep-nr"/>
+  <!-- Use the cclmap for author. Can be improved with a completeness. Needs to be overriden for SRU/Solr targets -->
   <metadata name="author" brief="yes" termlist="yes" merge="unique" 
-           rank="2" mergekey="optional"/>
+           rank="2" mergekey="optional" facetrule="facet-author" limitmap="ccl:au_exact" />
   <metadata name="author-title"/>
   <metadata name="author-date"/>
   <metadata name="corporate-name"/>
@@ -95,7 +98,8 @@
   <metadata name="title-dates" brief="yes" merge="longest"/>
   <metadata name="title-medium" brief="yes" merge="longest"/>
   <metadata name="title-number-section" brief="yes" merge="longest"/>
-  <metadata name="medium" brief="yes" merge="no" mergekey="optional"/>
+  <!-- Do a record filtering for medium -->
+  <metadata name="medium" brief="yes" merge="no" mergekey="optional" limitmap="local:" />
   <metadata name="iii-id" brief="yes" merge="no"/>
   <metadata name="edition"/>
   <metadata name="publication-place"/>
   <metadata name="series-title"/>
   
   <metadata name="description" brief="yes" merge="unique" rank="3"/>
+  <!-- Use the cclmap for subject. Can be improved with a completeness. Needs to be overriden for SRU/Solr targets -->
+  <metadata name="subject" termlist="yes" rank="0" facetrule="facet-subject" limitmap="ccl:su_exact" />
   <metadata name="subject-long" rank="3"/>
-  <metadata name="subject" termlist="yes" rank="0"/>
   <metadata name="snippet" brief="yes" merge="unique"/>
   <metadata name="electronic-url" brief="yes" merge="no"/>
   <metadata name="electronic-format-type" />
index 7615ee8..12945e0 100644 (file)
     <set name="pz:piggyback" value="1" />
 
     <!-- field-specific mappings -->
-    <set name="pz:cclmap:au" value="u=1004 s=al"/>
-    <set name="pz:cclmap:ti" value="u=4 s=al"/>
-    <set name="pz:cclmap:su" value="u=21 s=al"/>
-    <set name="pz:cclmap:isbn" value="u=7"/>
-    <set name="pz:cclmap:issn" value="u=8"/>
-    <set name="pz:cclmap:date" value="u=30 r=r"/>
+    <set name="pz:cclmap:au"       value="u=1004 s=al"/>
+    <set name="pz:cclmap:au_exact" value="u=1004 s=al 6=3 "/>
+    <set name="pz:cclmap:ti"       value="u=4 s=al"/>
+    <set name="pz:cclmap:su"       value="u=21 s=al"/>
+    <set name="pz:cclmap:su_exact" value="u=21 s=al 6=3"/>
+    <set name="pz:cclmap:isbn"     value="u=7"/>
+    <set name="pz:cclmap:issn"     value="u=8"/>
+    <set name="pz:cclmap:date"     value="u=30 r=r"/>
 
     <!-- Retrieval settings -->
 
@@ -76,8 +78,9 @@
   <metadata name="isbn"/>
   <metadata name="issn"/>
   <metadata name="tech-rep-nr"/>
+  <!-- Use the cclmap for author. Can be improved with a completeness. Needs to be overriden for SRU/Solr targets -->
   <metadata name="author" brief="yes" termlist="yes" merge="unique" 
-           rank="2" mergekey="optional"/>
+           rank="2" mergekey="optional" facetrule="facet-author" limitmap="ccl:au_exact" />
   <metadata name="author-title"/>
   <metadata name="author-date"/>
   <metadata name="corporate-name"/>
@@ -95,7 +98,8 @@
   <metadata name="title-dates" brief="yes" merge="longest"/>
   <metadata name="title-medium" brief="yes" merge="longest"/>
   <metadata name="title-number-section" brief="yes" merge="longest"/>
-  <metadata name="medium" brief="yes" merge="no" mergekey="optional"/>
+  <!-- Do a record filtering for medium -->
+  <metadata name="medium" brief="yes" merge="no" mergekey="optional" limitmap="local:" />
   <metadata name="iii-id" brief="yes" merge="no"/>
   <metadata name="edition"/>
   <metadata name="publication-place"/>
   <metadata name="series-title"/>
   
   <metadata name="description" brief="yes" merge="unique" rank="3"/>
+  <!-- Use the cclmap for subject. Can be improved with a completeness. Needs to be overriden for SRU/Solr targets -->
+  <metadata name="subject" termlist="yes" rank="0" facetrule="facet-subject" limitmap="ccl:su_exact" />
   <metadata name="subject-long" rank="3"/>
-  <metadata name="subject" termlist="yes" rank="0"/>
   <metadata name="snippet" brief="yes" merge="unique"/>
   <metadata name="electronic-url" brief="yes" merge="no"/>
   <metadata name="electronic-format-type" />
index 614a286..f5c5674 100644 (file)
     <set name="pz:piggyback" value="1" />
 
     <!-- field-specific mappings -->
-    <set name="pz:cclmap:au" value="u=1004 s=al"/>
-    <set name="pz:cclmap:ti" value="u=4 s=al"/>
-    <set name="pz:cclmap:su" value="u=21 s=al"/>
-    <set name="pz:cclmap:isbn" value="u=7"/>
-    <set name="pz:cclmap:issn" value="u=8"/>
-    <set name="pz:cclmap:date" value="u=30 r=r"/>
+    <set name="pz:cclmap:au"       value="u=1004 s=al"/>
+    <set name="pz:cclmap:au_exact" value="u=1004 s=al 6=3 "/>
+    <set name="pz:cclmap:ti"       value="u=4 s=al"/>
+    <set name="pz:cclmap:su"       value="u=21 s=al"/>
+    <set name="pz:cclmap:su_exact" value="u=21 s=al 6=3"/>
+    <set name="pz:cclmap:isbn"     value="u=7"/>
+    <set name="pz:cclmap:issn"     value="u=8"/>
+    <set name="pz:cclmap:date"     value="u=30 r=r"/>
 
     <!-- Retrieval settings -->
 
@@ -76,8 +78,9 @@
   <metadata name="isbn"/>
   <metadata name="issn"/>
   <metadata name="tech-rep-nr"/>
+  <!-- Use the cclmap for author. Can be improved with a completeness. Needs to be overriden for SRU/Solr targets -->
   <metadata name="author" brief="yes" termlist="yes" merge="unique" 
-           rank="2" mergekey="optional"/>
+           rank="2" mergekey="optional" facetrule="facet-author" limitmap="ccl:au_exact" />
   <metadata name="author-title"/>
   <metadata name="author-date"/>
   <metadata name="corporate-name"/>
@@ -95,7 +98,8 @@
   <metadata name="title-dates" brief="yes" merge="longest"/>
   <metadata name="title-medium" brief="yes" merge="longest"/>
   <metadata name="title-number-section" brief="yes" merge="longest"/>
-  <metadata name="medium" brief="yes" merge="no" mergekey="optional"/>
+  <!-- Do a record filtering for medium -->
+  <metadata name="medium" brief="yes" merge="no" mergekey="optional" limitmap="local:" />
   <metadata name="iii-id" brief="yes" merge="no"/>
   <metadata name="edition"/>
   <metadata name="publication-place"/>
   <metadata name="series-title"/>
   
   <metadata name="description" brief="yes" merge="unique" rank="3"/>
+  <!-- Use the cclmap for subject. Can be improved with a completeness. Needs to be overriden for SRU/Solr targets -->
+  <metadata name="subject" termlist="yes" rank="0" facetrule="facet-subject" limitmap="ccl:su_exact" />
   <metadata name="subject-long" rank="3"/>
-  <metadata name="subject" termlist="yes" rank="0"/>
   <metadata name="snippet" brief="yes" merge="unique"/>
   <metadata name="electronic-url" brief="yes" merge="no"/>
   <metadata name="electronic-format-type" />
index 6b997ca..829120e 100644 (file)
@@ -3,19 +3,21 @@
   <timeout session="30" z3950_operation="15" z3950_session="60"/>
   
   <settings target="*">
-    <set target="donut:8983/solr/select" name="pz:name" value="solr1"/>
-    <set target="satay:8983/solr/select" name="pz:name" value="solr2"/>
+    <set target="donut:8983/solr" name="pz:name" value="solr2"/>
+    <set target="ocs-test.indexdata.com/solr" name="pz:name" value="solr1"/>
 
     <!-- mapping for unqualified search -->
     <set name="pz:cclmap:term" value="1=title"/>
 
     <!-- field-specific mappings -->
-    <set name="pz:cclmap:au"   value="1=author" />
-    <set name="pz:cclmap:ti"   value="1=title"  />
-    <set name="pz:cclmap:su"   value="1=subject"/>
-    <set name="pz:cclmap:isbn" value="1=isbn" />
-    <set name="pz:cclmap:issn" value="1=issn" />
-    <set name="pz:cclmap:date" value="1=date" />
+    <set name="pz:cclmap:au"         value="1=author" />
+    <set name="pz:cclmap:au_exact"   value="1=author 6=3" />
+    <set name="pz:cclmap:ti"         value="1=title"  />
+    <set name="pz:cclmap:su"         value="1=subject"/>
+    <set name="pz:cclmap:su_exact"   value="1=subject 6=3"/>
+    <set name="pz:cclmap:isbn"       value="1=isbn" />
+    <set name="pz:cclmap:issn"       value="1=issn" />
+    <set name="pz:cclmap:date"       value="1=date" />
 
     <!-- Retrieval settings -->
 
@@ -64,7 +66,7 @@
   <metadata name="issn"/>
   <metadata name="tech-rep-nr"/>
   <metadata name="author" brief="yes" termlist="yes" merge="unique" 
-           rank="2" mergekey="optional"/>
+           rank="2" mergekey="optional" limitmap="ccl:au_exact"/>
   <metadata name="author-title"/>
   <metadata name="author-date"/>
   <metadata name="corporate-name"/>
@@ -82,7 +84,7 @@
   <metadata name="title-dates" brief="yes" merge="longest"/>
   <metadata name="title-medium" brief="yes" merge="longest"/>
   <metadata name="title-number-section" brief="yes" merge="longest"/>
-  <metadata name="medium" brief="yes" merge="no" mergekey="optional"/>
+  <metadata name="medium" brief="yes" merge="no" mergekey="optional" limitmap="ccl:medium_exact"/>
   <metadata name="iii-id" brief="yes" merge="no"/>
   <metadata name="edition"/>
   <metadata name="publication-place"/>
   <metadata name="series-title"/>
   
   <metadata name="description" brief="yes" merge="unique" rank="3"/>
+  <metadata name="subject" termlist="yes" rank="0" limitmap="ccl:su_exact"/>
   <metadata name="subject-long" rank="3"/>
-  <metadata name="subject" termlist="yes" rank="0"/>
   <metadata name="snippet" brief="yes" merge="unique"/>
   <metadata name="electronic-url" brief="yes" merge="no"/>
   <metadata name="electronic-format-type" />
diff --git a/etc/settings/edu_opac_turbo.xml b/etc/settings/edu_opac_turbo.xml
new file mode 100644 (file)
index 0000000..f84de6f
--- /dev/null
@@ -0,0 +1,72 @@
+<settings target="*">
+  <!-- based on edu.pz -->
+  <set target="acorn.library.vanderbilt.edu:2200/ACORN" name="pz:name" value="Vanderbilt U"/>
+  <set target="advance.biblio.polymtl.ca:210/ADVANCE" name="pz:name" value="Ecole Polytechnique Montreal"/>
+  <set target="albert.rit.edu:210/INNOPAC" name="pz:name" value="Rochester U of Tech"/>
+  <set target="atrium.bib.umontreal.ca:210/ADVANCE" name="pz:name" value="U of Montreal"/>
+  <set target="biblio.hec.ca:210/hec" name="pz:name" value="HEC Montreal"/>
+  <set target="books.luther.edu:210/innopac" name="pz:name" value="Luther College"/>
+  <set target="cat.cisti.nrc.ca:210/INNOPAC" name="pz:name" value="NRC Canada"/>
+  <set target="cat.lib.grin.edu:210/innopac" name="pz:name" value="Grinell College"/>
+  <set target="catalog.crl.edu:210/INNOPAC" name="pz:name" value="Center for Research Lib"/>
+  <set target="catalog.lib.jhu.edu:210/horizon" name="pz:name" value="Johns Hopkins U"/>
+  <set target="clavis.ucalgary.ca:2200/UNICORN" name="pz:name" value="U of Calgary"/>
+  <set target="cornelia.whoi.edu:7090/VOYAGER" name="pz:name" value="Woods Hole OI"/>
+  <set target="csulib.ctstateu.edu:210/INNOPAC" name="pz:name" value="CT State U"/>
+  <set target="info.library.mun.ca:2200/UNICORN" name="pz:name" value="Memorial U"/>
+  <set target="jasper.acadiau.ca:2200/UNICORN" name="pz:name" value="Acadia U"/>
+  <set target="ksclib.keene.edu:210/INNOPAC" name="pz:name" value="NH Keene State"/>
+  <set target="l1.uwaterloo.ca:7090/VOYAGER" name="pz:name" value="U of Waterloo"/>
+  <set target="lance.missouri.edu:210/INNOPAC" name="pz:name" value="U of Missouri"/>
+  <set target="library.daemen.edu:210/innopac" name="pz:name" value="Daemen C"/>
+  <set target="library.lbc.edu:7090/voyager" name="pz:name" value="Lancaster Bible C"/>
+  <set target="library.uh.edu:210/INNOPAC" name="pz:name" value="U of Houston"/>
+  <set target="lion.swem.wm.edu:2200/unicorn" name="pz:name" value="C of William and Mary"/>
+  <set target="lrpapp.cc.umanitoba.ca:2200/unicorn" name="pz:name" value="U of Manitoba"/>
+  <set target="malad2.mala.bc.ca:2200/UNICORN" name="pz:name" value="Malaspina U"/>
+  <set target="mercury.concordia.ca:210/Innopac" name="pz:name" value="Concordia U"/>
+  <set target="merlinweb.ville.montreal.qc.ca:2100/Z3950S" name="pz:name" value="U of Montreal"/>
+  <set target="ncsulib.lib.ncsu.edu:210/MARION" name="pz:name" value="North Carolina SU"/>
+  <set target="opac.utmem.edu:210/INNOPAC" name="pz:name" value="U of Tennessee"/>
+  <set target="prodorbis.library.yale.edu:7090/voyager" name="pz:name" value="Yale U"/>
+  <set target="quest.unb.ca:2200/unicorn" name="pz:name" value="U of New Brunswick"/>
+  <set target="rs6000.nshpl.library.ns.ca:210/AVR" name="pz:name" value="National Library Canada"/>
+  <set target="sabio.library.arizona.edu:210/innopac" name="pz:name" value="U of Arizona"/>
+  <set target="scotty.mhsl.uab.edu:7090/VOYAGER" name="pz:name" value="U of Alabama"/>
+  <set target="sundog.usask.ca:210/INNOPAC" name="pz:name" value="U of Saskatchewan"/>
+  <set target="titus.folger.edu:7090/VOYAGER" name="pz:name" value="Folger Shakespeare"/>
+  <set target="troy.lib.sfu.ca:210/INNOPAC" name="pz:name" value="Simon Fraser U"/>
+  <set target="voyager.tcs.tulane.edu:7090/VOYAGER" name="pz:name" value="Tulane U"/>
+  <set target="yulib001.mc.yu.edu:1111/DEFAULT" name="pz:name" value="Yeshiva U"/>
+  <set target="z3950.fcla.edu:210/CF" name="pz:name" value="Florida CLA"/>
+  <set target="z3950.library.wisc.edu:210/madison" name="pz:name" value="U of Wisconsin"/>
+  <set target="opencontent.indexdata.com:210/oca-all" name="pz:name" value="OCA American Libraries"/>
+  <set target="opencontent.indexdata.com:210/gutenberg" name="pz:name" value="Project Gutenberg"/>
+  <set target="z3950.loc.gov:7090/voyager" name="pz:name" value="Library of Congress"/>
+  <set target="melvyl.cdlib.org:210/CDL90" name="pz:name" value="University of California"/>
+  <set target="library.ox.ac.uk:210/ADVANCE" name="pz:name" value="Oxford University"/>
+
+  <!-- mapping for unqualified search -->
+  <set name="pz:cclmap:term" value="u=1016 t=l,r s=al"/>
+  
+  <!-- field-specific mappings -->
+  <set name="pz:cclmap:au" value="u=1004 s=al"/>
+  <set name="pz:cclmap:ti" value="u=4 s=al"/>
+  <set name="pz:cclmap:su" value="u=21 s=al"/>
+  <set name="pz:cclmap:isbn" value="u=7"/>
+  <set name="pz:cclmap:issn" value="u=8"/>
+  <set name="pz:cclmap:date" value="u=30 r=r"/>
+
+  <!-- Retrieval settings -->
+
+  <set name="pz:requestsyntax" value="opac"/>
+  <set name="pz:elements" value="F"/>
+
+  <!-- Result normalization settings -->
+
+  <set name="pz:nativesyntax" value="txml"/>
+  <set name="pz:xslt" value="opac_turbomarc.xsl"/>
+
+
+  <set name="open_url_resolver" value="http://someresolver.com"/>
+</settings>
index e2335da..e2c4cba 100644 (file)
--- a/js/pz2.js
+++ b/js/pz2.js
@@ -442,8 +442,9 @@ pz2.prototype =
               context.throwError('Show failed. Malformed WS resonse.',
                   114);
             };
+           
            var approxNode = data.getElementsByTagName("approximation");
-           if (approxNode)
+           if (approxNode && approxNode[0] && approxNode[0].childNodes[0] && approxNode[0].childNodes[0].nodeValue)
                show['approximation'] = 
                  Number( approxNode[0].childNodes[0].nodeValue);
              
diff --git a/nmen.stat b/nmen.stat
new file mode 100644 (file)
index 0000000..6b19c38
--- /dev/null
+++ b/nmen.stat
@@ -0,0 +1,14 @@
+4K
+user   0m5.296s
+sys    0m0.788s
+
+user   0m5.484s
+sys    0m0.732s
+
+100000
+user   0m5.272s
+sys    0m0.648s
+
+128K
+user   0m5.400s
+sys    0m0.768s
\ No newline at end of file
index 9e52b0a..59e06cd 100644 (file)
@@ -1092,7 +1092,7 @@ static int apply_limit(struct session_database *sdb,
     for (i = 0; (name = facet_limits_get(facet_limits, i, &value)); i++)
     {
         struct setting *s = 0;
-        
+        nmem_reset(nmem_tmp);
         for (s = sdb->settings[PZ_LIMITMAP]; s; s = s->next)
         {
             const char *p = strchr(s->name + 3, ':');
@@ -1148,7 +1148,6 @@ static int apply_limit(struct session_database *sdb,
                 break;
             }
         }
-        nmem_reset(nmem_tmp);
         if (!s)
         {
             yaz_log(YLOG_WARN, "Target %s: limit %s used, but no limitmap defined",
index d4b4a77..567189e 100644 (file)
@@ -498,6 +498,7 @@ static void cmd_settings(struct http_channel *c)
     {
         xmlDoc *doc = xmlParseMemory(rq->content_buf, rq->content_len);
         xmlNode *root_n;
+        int ret;
         if (!doc)
         {
             error(rs, PAZPAR2_MALFORMED_SETTING, 0);
@@ -505,10 +506,14 @@ static void cmd_settings(struct http_channel *c)
             return;
         }
         root_n = xmlDocGetRootElement(doc);
-
-        settings_read_node_x(root_n, s->psession, apply_local_setting);
-
+        ret = settings_read_node_x(root_n, s->psession, apply_local_setting);
         xmlFreeDoc(doc);
+        if (ret)
+        {
+            error(rs, PAZPAR2_MALFORMED_SETTING, 0);
+            release_session(c,s);
+            return;
+        }            
     }
     if (process_settings(s->psession, rq, rs) < 0)
     {
index 129be2b..90876e5 100644 (file)
@@ -52,52 +52,79 @@ normalize_record_t normalize_record_create(struct conf_service *service,
     NMEM nmem = nmem_create();
     normalize_record_t nt = nmem_malloc(nmem, sizeof(*nt));
     struct normalize_step **m = &nt->steps;
-    int i, num;
     int no_errors = 0;
-    char **stylesheets;
-    struct conf_config *conf = service->server->config;
+    int embed = 0;
+
+    if (*spec == '<')
+        embed = 1;
 
     nt->nmem = nmem;
 
-    nmem_strsplit(nt->nmem, ",", spec, &stylesheets, &num);
-    for (i = 0; i < num; i++)
+    if (embed)
     {
-        WRBUF fname = conf_get_fname(conf, stylesheets[i]);
-        
-        *m = nmem_malloc(nt->nmem, sizeof(**m));
-        (*m)->marcmap = NULL;
-        (*m)->stylesheet = NULL;
-
-        (*m)->stylesheet2 = service_xslt_get(service, stylesheets[i]);
-        if ((*m)->stylesheet2)
-            ;
-        else if (!strcmp(&stylesheets[i][strlen(stylesheets[i])-4], ".xsl")) 
-        {    
-            if (!((*m)->stylesheet =
-                  xsltParseStylesheetFile((xmlChar *) wrbuf_cstr(fname))))
-            {
-                yaz_log(YLOG_FATAL|YLOG_ERRNO, "Unable to load stylesheet: %s",
-                        stylesheets[i]);
+        xmlDoc *xsp_doc = xmlParseMemory(spec, strlen(spec));
+
+        if (!xsp_doc)
+            no_errors++;
+        {
+            *m = nmem_malloc(nt->nmem, sizeof(**m));
+            (*m)->marcmap = NULL;
+            (*m)->stylesheet = NULL;
+            (*m)->stylesheet2 = NULL;
+            
+            
+            (*m)->stylesheet = xsltParseStylesheetDoc(xsp_doc);
+            if (!(*m)->stylesheet)
                 no_errors++;
-            }
+            m = &(*m)->next;
         }
-        else if (!strcmp(&stylesheets[i][strlen(stylesheets[i])-5], ".mmap"))
+    }
+    else
+    {
+        struct conf_config *conf = service->server->config;
+        int i, num;
+        char **stylesheets;
+        nmem_strsplit(nt->nmem, ",", spec, &stylesheets, &num);
+
+        for (i = 0; i < num; i++)
         {
-            if (!((*m)->marcmap = marcmap_load(wrbuf_cstr(fname), nt->nmem)))
+            WRBUF fname = conf_get_fname(conf, stylesheets[i]);
+            
+            *m = nmem_malloc(nt->nmem, sizeof(**m));
+            (*m)->marcmap = NULL;
+            (*m)->stylesheet = NULL;
+            
+            (*m)->stylesheet2 = service_xslt_get(service, stylesheets[i]);
+            if ((*m)->stylesheet2)
+                ;
+            else if (!strcmp(&stylesheets[i][strlen(stylesheets[i])-4], ".xsl")) 
+            {    
+                if (!((*m)->stylesheet =
+                      xsltParseStylesheetFile((xmlChar *) wrbuf_cstr(fname))))
+                {
+                    yaz_log(YLOG_FATAL|YLOG_ERRNO, "Unable to load stylesheet: %s",
+                            stylesheets[i]);
+                    no_errors++;
+                }
+            }
+            else if (!strcmp(&stylesheets[i][strlen(stylesheets[i])-5], ".mmap"))
+            {
+                if (!((*m)->marcmap = marcmap_load(wrbuf_cstr(fname), nt->nmem)))
+                {
+                    yaz_log(YLOG_FATAL|YLOG_ERRNO, "Unable to load marcmap: %s",
+                            stylesheets[i]);
+                    no_errors++;
+                }
+            }
+            else
             {
-                yaz_log(YLOG_FATAL|YLOG_ERRNO, "Unable to load marcmap: %s",
-                        stylesheets[i]);
+                yaz_log(YLOG_FATAL, "Cannot handle stylesheet: %s", stylesheets[i]);
                 no_errors++;
             }
+            
+            wrbuf_destroy(fname);
+            m = &(*m)->next;
         }
-        else
-        {
-            yaz_log(YLOG_FATAL, "Cannot handle stylesheet: %s", stylesheets[i]);
-            no_errors++;
-        }
-
-        wrbuf_destroy(fname);
-        m = &(*m)->next;
     }
     *m = 0;  /* terminate list of steps */
 
index 0a67bee..bff5810 100644 (file)
@@ -607,19 +607,22 @@ static struct conf_service *service_create_static(struct conf_server *server,
                     continue;
                 if (!strcmp((const char *) n->name, "settings"))
                 {
+                    int ret;
                     xmlChar *src = xmlGetProp(n, (xmlChar *) "src");
                     if (src)
                     {
                         WRBUF w = wrbuf_alloc();
                         conf_dir_path(server->config, w, (const char *) src);
-                        settings_read_file(service, wrbuf_cstr(w), pass);
+                        ret = settings_read_file(service, wrbuf_cstr(w), pass);
                         wrbuf_destroy(w);
                         xmlFree(src);
                     }
                     else
                     {
-                        settings_read_node(service, n, pass);
+                        ret = settings_read_node(service, n, pass);
                     }
+                    if (ret)
+                        return 0;
                 }
             }
         }
@@ -627,8 +630,9 @@ static struct conf_service *service_create_static(struct conf_server *server,
     return service;
 }
 
-static void inherit_server_settings(struct conf_service *s)
+static int inherit_server_settings(struct conf_service *s)
 {
+    int ret = 0;
     struct conf_server *server = s->server;
     if (!s->dictionary) /* service has no config settings ? */
     {
@@ -636,8 +640,10 @@ static void inherit_server_settings(struct conf_service *s)
         {
             /* inherit settings from server */
             init_settings(s);
-            settings_read_file(s, server->settings_fname, 1);
-            settings_read_file(s, server->settings_fname, 2);
+            if (settings_read_file(s, server->settings_fname, 1))
+                ret = -1;
+            if (settings_read_file(s, server->settings_fname, 2))
+                ret = -1;
         }
         else
         {
@@ -660,6 +666,7 @@ static void inherit_server_settings(struct conf_service *s)
             s->charsets = pp2_charset_fact_create();
         }
     }
+    return ret;
 }
 
 struct conf_service *service_create(struct conf_server *server,
index 54b82da..0e1eea7 100644 (file)
@@ -408,40 +408,43 @@ const char *session_setting_oneval(struct session_database *db, int offset)
 // setting. However, this is not a realistic use scenario.
 static int prepare_map(struct session *se, struct session_database *sdb)
 {
-    const char *s;
-
-    if (sdb->settings && sdb->settings[PZ_XSLT] && !sdb->map &&
-        (s = session_setting_oneval(sdb, PZ_XSLT)))        
+    if (sdb->settings && !sdb->map)
     {
-        char auto_stylesheet[256];
+        const char *s;
 
-        if (!strcmp(s, "auto"))
+        if (sdb->settings[PZ_XSLT] &&
+            (s = session_setting_oneval(sdb, PZ_XSLT)))        
         {
-            const char *request_syntax = session_setting_oneval(
-                sdb, PZ_REQUESTSYNTAX);
-            if (request_syntax)
+            char auto_stylesheet[256];
+            
+            if (!strcmp(s, "auto"))
             {
-                char *cp;
-                yaz_snprintf(auto_stylesheet, sizeof(auto_stylesheet),
-                             "%s.xsl", request_syntax);
-                for (cp = auto_stylesheet; *cp; cp++)
+                const char *request_syntax = session_setting_oneval(
+                    sdb, PZ_REQUESTSYNTAX);
+                if (request_syntax)
                 {
-                    /* deliberately only consider ASCII */
-                    if (*cp > 32 && *cp < 127)
-                        *cp = tolower(*cp);
+                    char *cp;
+                    yaz_snprintf(auto_stylesheet, sizeof(auto_stylesheet),
+                                 "%s.xsl", request_syntax);
+                    for (cp = auto_stylesheet; *cp; cp++)
+                    {
+                        /* deliberately only consider ASCII */
+                        if (*cp > 32 && *cp < 127)
+                            *cp = tolower(*cp);
+                    }
+                    s = auto_stylesheet;
+                }
+                else
+                {
+                    session_log(se, YLOG_WARN,
+                                "No pz:requestsyntax for auto stylesheet");
                 }
-                s = auto_stylesheet;
-            }
-            else
-            {
-                session_log(se, YLOG_WARN,
-                            "No pz:requestsyntax for auto stylesheet");
             }
+            sdb->map = normalize_cache_get(se->normalize_cache,
+                                           se->service, s);
+            if (!sdb->map)
+                return -1;
         }
-        sdb->map = normalize_cache_get(se->normalize_cache,
-                                       se->service, s);
-        if (!sdb->map)
-            return -1;
     }
     return 0;
 }
@@ -689,6 +692,8 @@ enum pazpar2_error_code session_search(struct session *se,
     se->reclist = 0;
     se->settings_modified = 0;
     relevance_destroy(&se->relevance);
+    if (nmem_total(se->nmem))
+        session_log(se, YLOG_DEBUG, "NMEN operation usage %zd", nmem_total(se->nmem));
     nmem_reset(se->nmem);
     se->total_records = se->total_merged = 0;
     se->num_termlists = 0;
@@ -885,6 +890,10 @@ void session_destroy(struct session *se)
     normalize_cache_destroy(se->normalize_cache);
     relevance_destroy(&se->relevance);
     reclist_destroy(se->reclist);
+    if (nmem_total(se->nmem))
+        session_log(se, YLOG_DEBUG, "NMEN operation usage %zd", nmem_total(se->nmem));
+    if (nmem_total(se->session_nmem))
+        session_log(se, YLOG_DEBUG, "NMEN session usage %zd", nmem_total(se->session_nmem));
     nmem_destroy(se->nmem);
     service_destroy(se->service);
     yaz_mutex_destroy(&se->session_mutex);
index c41dc34..491ad08 100644 (file)
@@ -180,70 +180,84 @@ static int isdir(const char *path)
 }
 
 // Read settings from an XML file, calling handler function for each setting
-void settings_read_node_x(xmlNode *n,
-                          void *client_data,
-                          void (*fun)(void *client_data,
-                                      struct setting *set))
+int settings_read_node_x(xmlNode *n,
+                         void *client_data,
+                         void (*fun)(void *client_data,
+                                     struct setting *set))
 {
-    xmlChar *namea, *targeta, *valuea, *usera, *precedencea;
+    int ret_val = 0; /* success */
+    char *namea = (char *) xmlGetProp(n, (xmlChar *) "name");
+    char *targeta = (char *) xmlGetProp(n, (xmlChar *) "target");
+    char *valuea = (char *) xmlGetProp(n, (xmlChar *) "value");
+    char *usera = (char *) xmlGetProp(n, (xmlChar *) "user");
+    char *precedencea = (char *) xmlGetProp(n, (xmlChar *) "precedence");
 
-    namea = xmlGetProp(n, (xmlChar *) "name");
-    targeta = xmlGetProp(n, (xmlChar *) "target");
-    valuea = xmlGetProp(n, (xmlChar *) "value");
-    usera = xmlGetProp(n, (xmlChar *) "user");
-    precedencea = xmlGetProp(n, (xmlChar *) "precedence");
     for (n = n->children; n; n = n->next)
     {
         if (n->type != XML_ELEMENT_NODE)
             continue;
         if (!strcmp((const char *) n->name, "set"))
         {
-            char *name, *target, *value, *user, *precedence;
+            xmlNode *root = n->children;
+            struct setting set;
+            char *name = (char *) xmlGetProp(n, (xmlChar *) "name");
+            char *target = (char *) xmlGetProp(n, (xmlChar *) "target");
+            char *value = (char *) xmlGetProp(n, (xmlChar *) "value");
+            char *user = (char *) xmlGetProp(n, (xmlChar *) "user");
+            char *precedence = (char *) xmlGetProp(n, (xmlChar *) "precedence");
+            xmlChar *buf_out = 0;
+
+            set.next = 0;
+
+            if (precedence)
+                set.precedence = atoi((char *) precedence);
+            else if (precedencea)
+                set.precedence = atoi((char *) precedencea);
+            else
+                set.precedence = 0;
 
-            name = (char *) xmlGetProp(n, (xmlChar *) "name");
-            target = (char *) xmlGetProp(n, (xmlChar *) "target");
-            value = (char *) xmlGetProp(n, (xmlChar *) "value");
-            user = (char *) xmlGetProp(n, (xmlChar *) "user");
-            precedence = (char *) xmlGetProp(n, (xmlChar *) "precedence");
+            set.target = target ? target : targeta;
+            set.name = name ? name : namea;
 
-            if ((!name && !namea) || (!value && !valuea) || (!target && !targeta))
-            {
-                yaz_log(YLOG_FATAL, "set must specify name, value, and target");
-                exit(1);
+            while (root && root->type != XML_ELEMENT_NODE)
+                root = root->next;
+            if (!root)
+                set.value = value ? value : valuea;
+            else
+            {   /* xml document content for this setting */
+                xmlDoc *doc = xmlNewDoc(BAD_CAST "1.0");
+                if (!doc)
+                {
+                    if (set.name)
+                        yaz_log(YLOG_WARN, "bad XML content for setting "
+                                "name=%s", set.name);
+                    else
+                        yaz_log(YLOG_WARN, "bad XML content for setting");
+                    ret_val = -1;
+                }
+                else
+                {
+                    int len_out;
+                    xmlDocSetRootElement(doc, xmlCopyNode(root, 1));
+                    xmlDocDumpMemory(doc, &buf_out, &len_out);
+                    /* xmlDocDumpMemory 0-terminates */
+                    set.value = (char *) buf_out; 
+                    xmlFreeDoc(doc);
+                }
             }
+
+            if (set.name && set.value && set.target)
+                (*fun)(client_data, &set);
             else
             {
-                struct setting set;
-                char nameb[1024];
-                char targetb[1024];
-                char valueb[1024];
-
-                // Copy everything into a temporary buffer -- we decide
-                // later if we are keeping it.
-                if (precedence)
-                    set.precedence = atoi((char *) precedence);
-                else if (precedencea)
-                    set.precedence = atoi((char *) precedencea);
-                else
-                    set.precedence = 0;
-                if (target)
-                    strcpy(targetb, target);
-                else
-                    strcpy(targetb, (const char *) targeta);
-                set.target = targetb;
-                if (name)
-                    strcpy(nameb, name);
-                else
-                    strcpy(nameb, (const char *) namea);
-                set.name = nameb;
-                if (value)
-                    strcpy(valueb, value);
+                if (set.name)
+                    yaz_log(YLOG_WARN, "missing value and/or target for "
+                            "setting name=%s", set.name);
                 else
-                    strcpy(valueb, (const char *) valuea);
-                set.value = valueb;
-                set.next = 0;
-                (*fun)(client_data, &set);
+                    yaz_log(YLOG_WARN, "missing name/value/target for setting");
+                ret_val = -1;
             }
+            xmlFree(buf_out);
             xmlFree(name);
             xmlFree(precedence);
             xmlFree(value);
@@ -252,8 +266,9 @@ void settings_read_node_x(xmlNode *n,
         }
         else
         {
-            yaz_log(YLOG_FATAL, "Unknown element %s in settings file", (char*) n->name);
-            exit(1);
+            yaz_log(YLOG_WARN, "Unknown element %s in settings file", 
+                    (char*) n->name);
+            ret_val = -1;
         }
     }
     xmlFree(namea);
@@ -261,35 +276,39 @@ void settings_read_node_x(xmlNode *n,
     xmlFree(valuea);
     xmlFree(usera);
     xmlFree(targeta);
+    return ret_val;
 }
  
-static void read_settings_file(const char *path,
-                               void *client_data,
-                               void (*fun)(void *client_data,
-                                           struct setting *set))
+static int read_settings_file(const char *path,
+                              void *client_data,
+                              void (*fun)(void *client_data,
+                                          struct setting *set))
 {
     xmlDoc *doc = xmlParseFile(path);
     xmlNode *n;
+    int ret;
 
     if (!doc)
     {
         yaz_log(YLOG_FATAL, "Failed to parse %s", path);
-        exit(1);
+        return -1;
     }
     n = xmlDocGetRootElement(doc);
-    settings_read_node_x(n, client_data, fun);
+    ret = settings_read_node_x(n, client_data, fun);
 
     xmlFreeDoc(doc);
+    return ret;
 }
 
 
 // Recursively read files or directories, invoking a 
 // callback for each one
-static void read_settings(const char *path,
+static int read_settings(const char *path,
                           void *client_data,
                           void (*fun)(void *client_data,
                                       struct setting *set))
 {
+    int ret = 0;
     DIR *d;
     struct dirent *de;
     char *dot;
@@ -299,7 +318,7 @@ static void read_settings(const char *path,
         if (!(d = opendir(path)))
         {
             yaz_log(YLOG_FATAL|YLOG_ERRNO, "%s", path);
-            exit(1);
+            return -1;
         }
         while ((de = readdir(d)))
         {
@@ -307,12 +326,14 @@ static void read_settings(const char *path,
             if (*de->d_name == '.' || !strcmp(de->d_name, "CVS"))
                 continue;
             sprintf(tmp, "%s/%s", path, de->d_name);
-            read_settings(tmp, client_data, fun);
+            if (read_settings(tmp, client_data, fun))
+                ret = -1;
         }
         closedir(d);
     }
     else if ((dot = strrchr(path, '.')) && !strcmp(dot + 1, "xml"))
-        read_settings_file(path, client_data, fun);
+        ret = read_settings_file(path, client_data, fun);
+    return ret;
 }
 
 // Determines if a ZURL is a wildcard, and what kind
@@ -560,22 +581,22 @@ void init_settings(struct conf_service *service)
     initialize_soft_settings(service);
 }
 
-void settings_read_file(struct conf_service *service, const char *path,
-                        int pass)
+int settings_read_file(struct conf_service *service, const char *path,
+                       int pass)
 {
     if (pass == 1)
-        read_settings(path, service, prepare_target_dictionary);
+        return read_settings(path, service, prepare_target_dictionary);
     else
-        read_settings(path, service, update_databases);
+        return read_settings(path, service, update_databases);
 }
 
-void settings_read_node(struct conf_service *service, xmlNode *n,
+int settings_read_node(struct conf_service *service, xmlNode *n,
                         int pass)
 {
     if (pass == 1)
-        settings_read_node_x(n, service, prepare_target_dictionary);
+        return settings_read_node_x(n, service, prepare_target_dictionary);
     else
-        settings_read_node_x(n, service, update_databases);
+        return settings_read_node_x(n, service, update_databases);
 }
 
 /*
index 6ca2f6c..6351e9c 100644 (file)
@@ -72,18 +72,17 @@ struct settings_array
     int num_settings;
 };
 
-void settings_read_file(struct conf_service *service, const char *path,
-                        int pass);
-void settings_read_node(struct conf_service *service, xmlNode *n,
-                        int pass);
+int settings_read_file(struct conf_service *service, const char *path,
+                       int pass);
+int settings_read_node(struct conf_service *service, xmlNode *n, int pass);
 int settings_num(struct conf_service *service);
 int settings_create_offset(struct conf_service *service, const char *name);
 int settings_lookup_offset(struct conf_service *service, const char *name);
 void init_settings(struct conf_service *service);
-void settings_read_node_x(xmlNode *n,
-                          void *client_data,
-                          void (*fun)(void *client_data,
-                                      struct setting *set));
+int settings_read_node_x(xmlNode *n,
+                         void *client_data,
+                         void (*fun)(void *client_data,
+                                     struct setting *set));
 void expand_settings_array(struct setting ***set_ar, int *num, int offset,
                            NMEM nmem);
 
index e7b6e68..ea93130 100644 (file)
@@ -118,9 +118,10 @@ void termlist_insert(struct termlist *tl, const char *display_term,
         return;
     strcpy(buf, norm_term);
     /* chop right */
+    /*
     for (cp = buf + strlen(buf); cp != buf && strchr(",. -", cp[-1]); cp--)
         cp[-1] = '\0';
-    
+    */
     bucket = jenkins_hash((unsigned char *)buf) % tl->hash_size;
     for (p = &tl->hashtable[bucket]; *p; p = &(*p)->next)
     {
index 1699ff0..24b417f 100644 (file)
@@ -1,8 +1,11 @@
 # This file is part of Pazpar2.
+
+# These tests require a Solr target
+solr_tests = test_solr.sh test_termlist_block.sh test_limit_limitmap.sh
 check_SCRIPTS = test_http.sh test_icu.sh test_post.sh \
  test_settings.sh test_turbomarcxml.sh test_facets.sh \
- test_solr.sh test_url.sh test_filter.sh \
- test_termlist_block.sh test_limit_limitmap.sh
+ test_url.sh test_filter.sh \
+ $(solr_tests)
 
 EXTRA_DIST = run_pazpar2.sh marc21_test.xsl tmarc.xsl solr-pz2.xsl \
        z3950_indexdata_com_marc.xml \
@@ -13,7 +16,7 @@ EXTRA_DIST = run_pazpar2.sh marc21_test.xsl tmarc.xsl solr-pz2.xsl \
        test_post.cfg test_post.urls \
        test_settings.cfg test_settings.urls \
        test_solr.cfg test_solr.urls \
-       test_solr_settings_1.xml  test_solr_settings_2.xml  test_solr_settings_3.xml  test_solr_settings_4.xml \
+       test_solr_settings_1.xml  test_solr_settings_2.xml  test_solr_settings_3.xml  test_solr_settings_4.xml test_solr_settings_5.xml \
        test_turbomarcxml.cfg test_turbomarcxml.urls \
        test_url.cfg test_url.urls \
        test_filter.cfg test_filter.urls \
index 9fce24c..d1ae26e 100644 (file)
@@ -5,6 +5,14 @@
     <listen port="9763"/>
     <proxy host="localhost"/>
     
+    <icu_chain id="punctuation-trim" locale="en">
+      <transliterate>[[:WhiteSpace:][,.-]]* } [$] > ;</transliterate>
+    </icu_chain>
+
+    <icu_chain id="facet" locale="en">
+      <transliterate>[[:WhiteSpace:][,.!;]]* } [$] > ;</transliterate>
+    </icu_chain>
+
     <service>
       <include src="z3950_indexdata_com_marc.xml"/>
       <metadata name="url" merge="unique"/>
@@ -13,7 +21,7 @@
       <metadata name="isbn"/>
       <metadata name="date" brief="yes" sortkey="numeric" type="year" merge="range"
                termlist="yes"/>
-      <metadata name="author" brief="yes" termlist="yes" merge="longest" rank="2" mergekey="optional" />
+      <metadata name="author" brief="yes" termlist="yes" merge="longest" rank="2" mergekey="optional" facetrule="punctuation-trim" />
       <metadata name="subject" merge="unique" termlist="yes" rank="3"/>
       <metadata name="id"/>
       <metadata name="lccn" merge="unique"/>
index 6f07275..afa0e19 100644 (file)
@@ -3,6 +3,12 @@
   <!-- Used by test_filter.sh -->
   <server>
     <listen port="9763"/>
+
+    <!-- same as hardcoded rule -->
+    <icu_chain id="facet" locale="en">
+      <transliterate>[[:WhiteSpace:][,.!;]]* } [$] > ;</transliterate>
+    </icu_chain>
+
     <service>
       <settings target="*">
         <set target="localhost:9999/Slow" name="pz:name" value="ztest slow"/>
index 75e8842..d3d451e 100644 (file)
     </icu_chain>
     
     <icu_chain id="facet" locale="en">
-      <casemap rule="l"/>
+      <transliterate>[[:WhiteSpace:][,.!;]]* } [$] > ;</transliterate>
     </icu_chain>
 
     <icu_chain id="mychain" locale="en">
       <display/>
-      <casemap rule="l"/>
+      <transform rule="[[:WhiteSpace:][:Punctuation:]] Remove"/>
     </icu_chain>
-    
+
+    <icu_chain id="facet-author" locale="en">
+      <transliterate>
+       [,]* } [$] > ;
+      </transliterate>
+    </icu_chain>
+
     <service>
       <timeout session="30" z3950_operation="20" z3950_session="40"/>
       <metadata name="url" merge="unique"/>
@@ -47,7 +53,7 @@
       <metadata name="date" brief="yes" sortkey="numeric" type="year" merge="range"
                termlist="yes"/>
       <metadata name="author" brief="yes" termlist="yes"
-                merge="longest" rank="2" facetrule="mychain"/>
+                merge="longest" rank="2" facetrule="facet-author" />
       <metadata name="subject" merge="unique" termlist="yes" rank="3"/>
       <metadata name="id"/>
       <metadata name="lccn" merge="unique"/>
index ed8bdcf..7380b62 100644 (file)
@@ -7,18 +7,18 @@
 <term><name>Wood, Helen M.</name><frequency>1</frequency></term>
 </list>
 <list name="subject">
-<term><name>bible</name><frequency>1</frequency></term>
-<term><name>bible. o.t</name><frequency>1</frequency></term>
-<term><name>cartography</name><frequency>1</frequency></term>
-<term><name>community colleges</name><frequency>1</frequency></term>
-<term><name>computers</name><frequency>1</frequency></term>
-<term><name>imaging systems in medicine</name><frequency>1</frequency></term>
-<term><name>optical pattern recognition</name><frequency>1</frequency></term>
-<term><name>puget sound region (wash.)</name><frequency>1</frequency></term>
-<term><name>radioisotope scanning</name><frequency>1</frequency></term>
-<term><name>railroads</name><frequency>1</frequency></term>
-<term><name>scintillation cameras</name><frequency>1</frequency></term>
-<term><name>tomography</name><frequency>1</frequency></term>
-<term><name>universities and colleges</name><frequency>1</frequency></term>
+<term><name>Bible</name><frequency>1</frequency></term>
+<term><name>Bible. O.T</name><frequency>1</frequency></term>
+<term><name>Cartography</name><frequency>1</frequency></term>
+<term><name>Community colleges</name><frequency>1</frequency></term>
+<term><name>Computers</name><frequency>1</frequency></term>
+<term><name>Imaging systems in medicine</name><frequency>1</frequency></term>
+<term><name>Optical pattern recognition</name><frequency>1</frequency></term>
+<term><name>Puget Sound region (Wash.)</name><frequency>1</frequency></term>
+<term><name>Radioisotope scanning</name><frequency>1</frequency></term>
+<term><name>Railroads</name><frequency>1</frequency></term>
+<term><name>Scintillation cameras</name><frequency>1</frequency></term>
+<term><name>Tomography</name><frequency>1</frequency></term>
+<term><name>Universities and colleges</name><frequency>1</frequency></term>
 </list>
 </termlist>
\ No newline at end of file
index 9b12a05..a8c2974 100644 (file)
@@ -4,6 +4,10 @@
   <server>
     <listen port="9763"/>
     <proxy host="localhost"/>
+
+    <icu_chain id="facet" locale="en">
+      <transliterate>[[:WhiteSpace:][,.!;]]* } [$] > ;</transliterate>
+    </icu_chain>
   </server>
   
 </pazpar2>
index 994f9eb..e40b12d 100644 (file)
@@ -21,6 +21,6 @@ http://localhost:9763/search.pz2?session=1&command=bytarget
 http://localhost:9763/search.pz2?session=1&command=show
 test_limit_limitmap_settings_4.xml http://localhost:9763/search.pz2?session=1&command=settings
 http://localhost:9763/search.pz2?session=1&command=search&query=computer&limit=Mysubject%3DRailroads
-4 http://localhost:9763/search.pz2?session=1&command=show&block=1
+1 http://localhost:9763/search.pz2?session=1&command=show&block=1
 http://localhost:9763/search.pz2?session=1&command=search&query=computer&limit=date%3D1977
-http://localhost:9763/search.pz2?session=1&command=show&block=1
\ No newline at end of file
+http://localhost:9763/search.pz2?session=1&command=show&block=1
index 9f9ccad..64ca61c 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <show><status>OK</status>
-<activeclients>2</activeclients>
-<merged>60</merged>
-<total>2015</total>
+<activeclients>0</activeclients>
+<merged>109</merged>
+<total>2025</total>
 <start>0</start>
 <num>20</num>
 <hit>
@@ -15,7 +15,7 @@
 <md-title-remainder>fast &amp; easy</md-title-remainder>
 <md-date>2001</md-date>
 <md-author>Woodward, C. Michael</md-author></location>
-<relevance>30776</relevance>
+<relevance>45304</relevance>
 <recid>content: title adobe illustrator for the mac author woodward c michael</recid>
 </hit>
 <hit>
@@ -24,7 +24,7 @@
 <md-date>1998</md-date><location id="Target-2" name="LOC-SOLR">
 <md-title>Advanced computer performance modeling and simulation</md-title>
 <md-date>1998</md-date></location>
-<relevance>30776</relevance>
+<relevance>45304</relevance>
 <recid>content: title advanced computer performance modeling and simulation</recid>
 </hit>
 <hit>
@@ -39,7 +39,7 @@
 <md-date>2000</md-date>
 <md-author>Aldrich, Richard W</md-author>
 <md-description>&quot;April 2000.&quot;</md-description></location>
-<relevance>30776</relevance>
+<relevance>45304</relevance>
 <recid>content: title cyberterrorism and computer crimes author aldrich richard w</recid>
 </hit>
 <hit>
@@ -52,7 +52,7 @@
 <md-title-remainder>talks with Bonnie Nardi, Jakob Nielsen, David Smith, Austin Henderson &amp; Jed Harris, Terry Winograd, Stephanie Rosenbaum</md-title-remainder>
 <md-date>2000</md-date>
 <md-author>Kaasgaard, Klaus</md-author></location>
-<relevance>28211</relevance>
+<relevance>41529</relevance>
 <recid>content: title software design and usability author kaasgaard klaus</recid>
 </hit>
 <hit>
 <md-date>2000</md-date>
 <md-author>Knittel, John</md-author>
 <md-description>Explains what computer hacking is, who does it, and how dangerous it can be</md-description></location>
-<relevance>26979</relevance>
+<relevance>39715</relevance>
 <recid>content: title everything you need to know about the dangers of computer hacking author knittel john</recid>
 </hit>
 <hit>
 
+<md-title>Computer peripherals</md-title>
+<md-date>1995</md-date>
+<md-author>Cook, Barry M</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Computer peripherals</md-title>
+<md-date>1995</md-date>
+<md-author>Cook, Barry M</md-author></location>
+<relevance>39641</relevance>
+<recid>content: title computer peripherals author cook barry m</recid>
+</hit>
+<hit>
+
 <md-title>Kids&apos; computer book</md-title>
 <md-date>1994</md-date>
 <md-description>Discusses a variety of educational and game software for children  with suggestions for setting up a computer system. Includes a 3 1/2 in. disk with 6 shareware programs for children</md-description><location id="Target-2" name="LOC-SOLR">
@@ -77,7 +88,7 @@
 <md-date>1994</md-date>
 <md-description>&quot;For kids and their parents&quot;--Cover</md-description>
 <md-description>Discusses a variety of educational and game software for children  with suggestions for setting up a computer system. Includes a 3 1/2 in. disk with 6 shareware programs for children</md-description></location>
-<relevance>23651</relevance>
+<relevance>34817</relevance>
 <recid>content: title kids computer book</recid>
 </hit>
 <hit>
@@ -88,7 +99,7 @@
 <md-title>Computer friendly</md-title>
 <md-date>1999</md-date>
 <md-author>Steinbacher, Raymond</md-author></location>
-<relevance>23082</relevance>
+<relevance>33978</relevance>
 <recid>content: title computer friendly author steinbacher raymond</recid>
 </hit>
 <hit>
 <md-description>&quot;May 1999.&quot;</md-description>
 <md-description>&quot;NZLC R54&quot;--T.p. verso</md-description>
 <md-description>&quot;Also published as Parliamentary Paper E 31AO&quot;--T.p. verso</md-description></location>
-<relevance>23082</relevance>
+<relevance>33978</relevance>
 <recid>content: title computer misuse</recid>
 </hit>
 <hit>
 
+<md-title>Computer networking</md-title>
+<md-title-remainder>a top-down approach featuring the Internet</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Ross, Keith W</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Computer networking</md-title>
+<md-title-remainder>a top-down approach featuring the Internet</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Ross, Keith W</md-author></location>
+<relevance>33978</relevance>
+<recid>content: title computer networking author ross keith w</recid>
+</hit>
+<hit>
+
+<md-title>CorelDRAW 8 for Windows</md-title>
+<md-date>1998</md-date>
+<md-author>Davis, Phyllis</md-author>
+<md-description>Includes index</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>CorelDRAW 8 for Windows</md-title>
+<md-date>1998</md-date>
+<md-author>Davis, Phyllis</md-author>
+<md-description>Includes index</md-description></location>
+<relevance>33978</relevance>
+<recid>content: title coreldraw for windows author davis phyllis</recid>
+</hit>
+<hit>
+
 <md-title>Quicken 2000 for the Mac</md-title>
 <md-title-remainder>the official guide</md-title-remainder>
 <md-date>2000</md-date>
 <md-author>Langer, Maria</md-author>
 <md-description>Includes index</md-description>
 <md-description>&quot;Covers Quicken deluxe 2000 for the Mac&quot;--Cover</md-description></location>
-<relevance>23082</relevance>
+<relevance>33978</relevance>
 <recid>content: title quicken for the mac author langer maria</recid>
 </hit>
 <hit>
 
+<md-title>Sicherheit und Schutz im Netz</md-title>
+<md-date>1998</md-date><location id="Target-2" name="LOC-SOLR">
+<md-title>Sicherheit und Schutz im Netz</md-title>
+<md-date>1998</md-date></location>
+<relevance>33978</relevance>
+<recid>content: title sicherheit und schutz im netz</recid>
+</hit>
+<hit>
+
 <md-title>Unix Secure Shell</md-title>
 <md-date>1999</md-date>
 <md-author>Carasik, Anne H</md-author>
 <md-date>1999</md-date>
 <md-author>Carasik, Anne H</md-author>
 <md-description>Includes index</md-description></location>
-<relevance>23082</relevance>
+<relevance>33978</relevance>
 <recid>content: title unix secure shell author carasik anne h</recid>
 </hit>
 <hit>
 <md-title-remainder>proceedings, 11-13 October 1999, Boston, Massachusetts</md-title-remainder>
 <md-date>1999</md-date>
 <md-description>&quot;IEEE catalog number 99EX370&quot;--T.p. verso</md-description></location>
-<relevance>21799</relevance>
+<relevance>32090</relevance>
 <recid>content: title eight international conference on computer communications and networks</recid>
 </hit>
 <hit>
 
+<md-title>Building storage networks</md-title>
+<md-date>2000</md-date>
+<md-author>Farley, Marc</md-author>
+<md-description>Includes index</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Building storage networks</md-title>
+<md-date>2000</md-date>
+<md-author>Farley, Marc</md-author>
+<md-description>Includes index</md-description></location>
+<relevance>30203</relevance>
+<recid>content: title building storage networks author farley marc</recid>
+</hit>
+<hit>
+
 <md-title>Complete CL</md-title>
 <md-title-remainder>the definitive control language programming guide</md-title-remainder>
 <md-date>1999</md-date>
 <md-date>1999</md-date>
 <md-author>Malaga, Ernie</md-author>
 <md-description>Includes index</md-description></location>
-<relevance>20517</relevance>
+<relevance>30203</relevance>
 <recid>content: title complete cl author malaga ernie</recid>
 </hit>
 <hit>
 <md-title-remainder>real-time rendering and software technology</md-title-remainder>
 <md-date>2001</md-date>
 <md-author>Watt, Alan H</md-author></location>
-<relevance>20517</relevance>
+<relevance>30203</relevance>
 <recid>content: title d games author watt alan h</recid>
 </hit>
 <hit>
 
+<md-title>Java applications strategies for the AS/400</md-title>
+<md-date>1999</md-date>
+<md-author>Denoncourt, Don</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Java applications strategies for the AS/400</md-title>
+<md-date>1999</md-date>
+<md-author>Denoncourt, Don</md-author></location>
+<relevance>30203</relevance>
+<recid>content: title java applications strategies for the as author denoncourt don</recid>
+</hit>
+<hit>
+
 <md-title>Mastering algorithms with C</md-title>
 <md-date>1999</md-date>
 <md-author>Loudon, Kyle</md-author>
 <md-author>Loudon, Kyle</md-author>
 <md-description>&quot;Useful techniques from sorting to encryption&quot;--Cover</md-description>
 <md-description>Includes index</md-description></location>
-<relevance>20517</relevance>
+<relevance>30203</relevance>
 <recid>content: title mastering algorithms with c author loudon kyle</recid>
 </hit>
-<hit>
-
-<md-title>Programming Web graphics with PERL and GNU software</md-title>
-<md-date>1999</md-date>
-<md-author>Wallace, Shawn P</md-author><location id="Target-2" name="LOC-SOLR">
-<md-title>Programming Web graphics with PERL and GNU software</md-title>
-<md-date>1999</md-date>
-<md-author>Wallace, Shawn P</md-author></location>
-<relevance>20517</relevance>
-<recid>content: title programming web graphics with perl and gnu software author wallace shawn p</recid>
-</hit>
-<hit>
-
-<md-title>4th ACM Conference on Computer and Communications Security, April 1-4, 1997, Zurich, Switzerland</md-title>
-<md-date>1997</md-date><location id="Target-2" name="LOC-SOLR">
-<md-title>4th ACM Conference on Computer and Communications Security, April 1-4, 1997, Zurich, Switzerland</md-title>
-<md-date>1997</md-date></location>
-<relevance>18185</relevance>
-<recid>content: title th acm conference on computer and communications security april zurich switzerland</recid>
-</hit>
-<hit>
-
-<md-title>3D computer graphics</md-title>
-<md-date>2000</md-date>
-<md-author>Watt, Alan H</md-author><location id="Target-2" name="LOC-SOLR">
-<md-title>3D computer graphics</md-title>
-<md-date>2000</md-date>
-<md-author>Watt, Alan H</md-author></location>
-<relevance>17952</relevance>
-<recid>content: title d computer graphics author watt alan h</recid>
-</hit>
-<hit>
-
-<md-title>Insanely great</md-title>
-<md-title-remainder>the life and times of Macintosh, the computer that changed everything</md-title-remainder>
-<md-date>2000</md-date>
-<md-author>Levy, Steven</md-author><location id="Target-2" name="LOC-SOLR">
-<md-title>Insanely great</md-title>
-<md-title-remainder>the life and times of Macintosh, the computer that changed everything</md-title-remainder>
-<md-date>2000</md-date>
-<md-author>Levy, Steven</md-author></location>
-<relevance>17719</relevance>
-<recid>content: title insanely great author levy steven</recid>
-</hit>
-<hit>
-
-<md-title>Careers in computer animation</md-title>
-<md-date>2001</md-date>
-<md-author>Shires, Jeremy</md-author><location id="Target-2" name="LOC-SOLR">
-<md-title>Careers in computer animation</md-title>
-<md-date>2001</md-date>
-<md-author>Shires, Jeremy</md-author></location>
-<relevance>15388</relevance>
-<recid>content: title careers in computer animation author shires jeremy</recid>
-</hit>
-<hit>
-
-<md-title>Hackers beware</md-title>
-<md-date>2002</md-date>
-<md-author>Cole, Eric</md-author><location id="Target-2" name="LOC-SOLR">
-<md-title>Hackers beware</md-title>
-<md-date>2002</md-date>
-<md-author>Cole, Eric</md-author></location>
-<relevance>15388</relevance>
-<recid>content: title hackers beware author cole eric</recid>
-</hit>
 </show>
\ No newline at end of file
index 117f75a..313cf71 100644 (file)
@@ -1,4 +1,4 @@
 <settings target="ID_1">
   <set name="pz:limitmap:author"  value="rpn:@attr 1=1003 @attr 6=3" />
-  <set name="pz:limitmap:subject" value="rpn:@attr 1=21 @attr 6=3" />
+  <set name="pz:limitmap:subject" value="rpn:@attr 1=21 @attr 6=3" />  
 </settings>
index bcd1e71..43bfdee 100644 (file)
@@ -1,4 +1,5 @@
 <settings target="Target-1">
   <set name="pz:limitmap:author"  value="rpn:@attr 1=1003 @attr 6=3" />
   <set name="pz:limitmap:subject" value="rpn:@attr 1=21 @attr 6=3" />
+  <set name="pz:limitmap:Mysubject" value="local:subject" />
 </settings>
index 0d3528f..6004c29 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<settings target="Target-1">
-  <set name="pz:limitmap:MySubject" value="local:subject" />
+<settings target="Target-2">
+  <set name="pz:limitmap:Mysubject" value="local:subject" />
 </settings>
 
 
index 3bf0975..0531283 100644 (file)
@@ -1,12 +1,11 @@
 marc_service.xml http://localhost:9763/search.pz2?command=init
-http://localhost:9763/search.pz1?session=1&command=search&query=computer
+http://localhost:9763/search.pz2?session=1&command=search&query=computer
 gils_service.xml http://localhost:9763/search.pz2?command=init
-http://localhost:9763/search.pz1?session=2&command=search&query=computer
+http://localhost:9763/search.pz2?session=2&command=search&query=computer
 gils_service.xml http://localhost:9763/search.pz2?command=init&clear=1
-z3950_indexdata_com_marc.xml
-http://localhost:9763/search.pz1?session=3&command=settings
-http://localhost:9763/search.pz1?session=3&command=search&query=computer
-2 http://localhost:9763/search.pz1?session=1&command=show
-http://localhost:9763/search.pz1?session=2&command=show
-http://localhost:9763/search.pz1?session=3&command=show
-http://localhost:9763/search.pz1?session=3&command=bytarget
+z3950_indexdata_com_marc.xml http://localhost:9763/search.pz2?session=3&command=settings
+http://localhost:9763/search.pz2?session=3&command=search&query=computer
+2 http://localhost:9763/search.pz2?session=1&command=show
+http://localhost:9763/search.pz2?session=2&command=show
+http://localhost:9763/search.pz2?session=3&command=show
+http://localhost:9763/search.pz2?session=3&command=bytarget
index 1c30567..81d1680 100644 (file)
@@ -4,6 +4,12 @@
   <server>
     <listen port="9763"/>
     
+    <!-- same as hardcoded rule -->
+    <icu_chain id="facet" locale="en">
+      <transliterate>[[:WhiteSpace:][,.!;]]* } [$] > ;</transliterate>
+    </icu_chain>
+
+    
     <service>
       <metadata name="url" merge="unique"/>
       <metadata name="title" brief="yes" sortkey="skiparticle" merge="longest" rank="6" mergekey="required" />
index 89eb314..5908f77 100644 (file)
@@ -18,5 +18,12 @@ http://localhost:9763/search.pz2?session=1&command=search&query=water&maxrecs=20
 3 http://localhost:9763/search.pz2?session=1&command=show
 http://localhost:9763/search.pz2?session=1&command=bytarget
 http://localhost:9763/search.pz2?session=1&command=termlist&name=xtargets%2Csubject%2Cauthor%2Cdate%2Cmedium
-http://localhost:9763/search.pz2?session=1&command=search&query=water&limit=subject%3A=N.Y
+http://localhost:9763/search.pz2?session=1&command=search&query=water&limit=subject%3DN.Y
+3 http://localhost:9763/search.pz2?session=1&command=show
+test_solr_settings_5.xml http://localhost:9763/search.pz2?session=1&command=settings
+http://localhost:9763/search.pz2?session=1&command=search&query=water
+3 http://localhost:9763/search.pz2?session=1&command=show
+http://localhost:9763/search.pz2?session=1&command=bytarget
+http://localhost:9763/search.pz2?session=1&command=termlist&name=xtargets%2Csubject%2Cauthor%2Cdate%2Cmedium
+http://localhost:9763/search.pz2?session=1&command=search&query=water&limit=subject%3DN.Y
 3 http://localhost:9763/search.pz2?session=1&command=show
index 79896b2..00b1fd7 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
 <show><status>OK</status>
 <activeclients>0</activeclients>
-<merged>195</merged>
-<total>1995</total>
+<merged>2</merged>
+<total>2</total>
 <start>0</start>
-<num>20</num>
+<num>2</num>
 <hit>
 
-<md-title>Water</md-title>
-<md-date>1999</md-date>
-<md-author>De Villiers, Marq</md-author>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Water</md-title>
-<md-date>1999</md-date>
-<md-author>De Villiers, Marq</md-author>
-<md-medium>book</md-medium></location>
-<relevance>29115</relevance>
-<recid>content: title water author de villiers marq medium book</recid>
-</hit>
-<hit>
-
-<md-title>Potable water and methods of detecting impurities</md-title>
-<md-date>1899-1906</md-date>
-<md-author>Baker, M. N</md-author>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Potable water and methods of detecting impurities</md-title>
-<md-date>1906</md-date>
-<md-author>Baker, M. N</md-author>
-<md-medium>book</md-medium></location>
-<location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Potable water and methods of detecting impurities</md-title>
-<md-date>1899</md-date>
-<md-author>Baker, M. N</md-author>
-<md-medium>book</md-medium></location>
-<count>2</count>
-<relevance>27126</relevance>
-<recid>content: title potable water and methods of detecting impurities author baker m n medium book</recid>
-</hit>
-<hit>
-
-<md-title>Water</md-title>
-<md-date>2000</md-date>
-<md-author>Majeed, Abdul</md-author>
-<md-description>&quot;Balochistan conservation strategy background paper&quot;--T.p</md-description>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Water</md-title>
-<md-date>2000</md-date>
-<md-author>Majeed, Abdul</md-author>
-<md-description>&quot;Balochistan conservation strategy background paper&quot;--T.p</md-description>
-<md-medium>book</md-medium></location>
-<relevance>25317</relevance>
-<recid>content: title water author majeed abdul medium book</recid>
-</hit>
-<hit>
-
-<md-title>Water</md-title>
-<md-date>2000</md-date>
-<md-author>Grant, Pamela</md-author>
-<md-description>Examines major environmental issues surrounding water, giving examples of attempts to solve global problems and sources for more information</md-description>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Water</md-title>
-<md-date>2000</md-date>
-<md-author>Grant, Pamela</md-author>
-<md-description>Includes index</md-description>
-<md-description>Examines major environmental issues surrounding water, giving examples of attempts to solve global problems and sources for more information</md-description>
-<md-medium>book</md-medium></location>
-<relevance>23185</relevance>
-<recid>content: title water author grant pamela medium book</recid>
-</hit>
-<hit>
-
-<md-title>Water law</md-title>
-<md-date>2000</md-date>
-<md-author>Fisher, D. E</md-author>
-<md-description>Includes index</md-description>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Water law</md-title>
-<md-date>2000</md-date>
-<md-author>Fisher, D. E</md-author>
-<md-description>Includes index</md-description>
-<md-medium>book</md-medium></location>
-<relevance>22786</relevance>
-<recid>content: title water law author fisher d e medium book</recid>
-</hit>
-<hit>
-
-<md-title>A Primer on fresh water</md-title>
-<md-title-remainder>questions and answers</md-title-remainder>
-<md-date>2000</md-date>
-<md-description>Issued also in French under title: Notions élémentaires sur l&apos;eau douce : questions et réponses</md-description>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>A Primer on fresh water</md-title>
-<md-title-remainder>questions and answers</md-title-remainder>
-<md-date>2000</md-date>
-<md-description>Issued also in French under title: Notions élémentaires sur l&apos;eau douce : questions et réponses</md-description>
-<md-description>Includes index</md-description>
-<md-medium>book</md-medium></location>
-<relevance>22026</relevance>
-<recid>content: title a primer on fresh water medium book</recid>
-</hit>
-<hit>
-
-<md-title>Water and water supplies</md-title>
-<md-date>1901</md-date>
-<md-author>Thresh, John Clough</md-author>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Water and water supplies</md-title>
-<md-date>1901</md-date>
-<md-author>Thresh, John Clough</md-author>
-<md-medium>book</md-medium></location>
-<relevance>18988</relevance>
-<recid>content: title water and water supplies author thresh john clough medium book</recid>
-</hit>
-<hit>
-
-<md-title>Water quality assessment of the State Water Project, 1996-97</md-title>
-<md-date>1999-2000</md-date>
-<md-description>&quot;September 1999.&quot;</md-description>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Water quality assessment of the State Water Project, 1998-99</md-title>
-<md-date>2000</md-date>
-<md-description>Cover title</md-description>
-<md-description>&quot;July 2000.&quot;</md-description>
-<md-medium>book</md-medium></location>
-<location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Water quality assessment of the State Water Project, 1996-97</md-title>
-<md-date>1999</md-date>
-<md-description>Cover title</md-description>
-<md-description>&quot;September 1999.&quot;</md-description>
-<md-medium>book</md-medium></location>
-<count>2</count>
-<relevance>18988</relevance>
-<recid>content: title water quality assessment of the state water project medium book</recid>
-</hit>
-<hit>
-
-<md-title>Water-supply</md-title>
-<md-title-remainder>(Considered principally from a sanitary standpoint.)</md-title-remainder>
-<md-date>1896</md-date>
-<md-author>Mason, William Pitt</md-author>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Water-supply</md-title>
-<md-title-remainder>(Considered principally from a sanitary standpoint.)</md-title-remainder>
-<md-date>1896</md-date>
-<md-author>Mason, William Pitt</md-author>
-<md-medium>book</md-medium></location>
-<relevance>18988</relevance>
-<recid>content: title water supply author mason william pitt medium book</recid>
-</hit>
-<hit>
-
-<md-title>The law of waters and water rights</md-title>
-<md-title-remainder>international, national, state, municipal, and individual, including irrigation, drainage, and municipal water supply</md-title-remainder>
-<md-date>1904</md-date>
-<md-author>Farnham, Henry P</md-author>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>The law of waters and water rights</md-title>
-<md-title-remainder>international, national, state, municipal, and individual, including irrigation, drainage, and municipal water supply</md-title-remainder>
-<md-date>1904</md-date>
-<md-author>Farnham, Henry P</md-author>
-<md-medium>book</md-medium></location>
-<relevance>18334</relevance>
-<recid>content: title the law of waters and water rights author farnham henry p medium book</recid>
-</hit>
-<hit>
-
-<md-title>Water, in press, 1998</md-title>
-<md-title-remainder>an index of news items on water resources selected from leading news papers</md-title-remainder>
-<md-date>1998-1999</md-date>
-<md-description>With reference to India</md-description>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Water, in press, 1998</md-title>
-<md-title-remainder>an index to news items on water resources selected from leading news papers</md-title-remainder>
-<md-date>1999</md-date>
-<md-description>Includes index</md-description>
-<md-medium>book</md-medium></location>
-<location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Water in press, 1997</md-title>
-<md-title-remainder>an index of news items on water resources selected from leading news papers</md-title-remainder>
-<md-date>1998</md-date>
-<md-description>Includes index</md-description>
-<md-description>With reference to India</md-description>
-<md-medium>book</md-medium></location>
-<count>2</count>
-<relevance>17138</relevance>
-<recid>content: title water in press medium book</recid>
-</hit>
-<hit>
-
-<md-title>Water-power</md-title>
-<md-title-remainder>an outline of the development and application of the energy of flowing water</md-title-remainder>
-<md-date>1900-1901</md-date>
-<md-author>Frizell, Joseph P</md-author>
-<md-description>Original imprint 1901, corrected to 1900</md-description>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Water-power</md-title>
-<md-title-remainder>an outline of the development and application of the energy of flowing water</md-title-remainder>
-<md-date>1901</md-date>
-<md-author>Frizell, Joseph P</md-author>
-<md-medium>book</md-medium></location>
-<location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Water-power</md-title>
-<md-title-remainder>an outline of the development and application of the energy of flowing water</md-title-remainder>
-<md-date>1900</md-date>
-<md-author>Frizell, Joseph P</md-author>
-<md-description>Original imprint 1901, corrected to 1900</md-description>
-<md-medium>book</md-medium></location>
-<count>2</count>
-<relevance>17138</relevance>
-<recid>content: title water power author frizell joseph p medium book</recid>
-</hit>
-<hit>
-
-<md-title>Water-supply engineering</md-title>
-<md-title-remainder>The designing, construction, and maintenance of water-supply systems, both city and irrigation</md-title-remainder>
-<md-date>1903-1909</md-date>
-<md-author>Folwell, Amory Prescott</md-author>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Water-supply engineering</md-title>
-<md-title-remainder>The designing, construction, and maintenance of water-supply systems, both city and irrigation</md-title-remainder>
-<md-date>1909</md-date>
-<md-author>Folwell, Amory Prescott</md-author>
-<md-medium>book</md-medium></location>
-<location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Water-supply engineering</md-title>
-<md-title-remainder>The designing, construction, and maintenance of water-supply systems, both city and irrigation</md-title-remainder>
-<md-date>1903</md-date>
-<md-author>Folwell, Amory Prescott</md-author>
-<md-medium>book</md-medium></location>
-<count>2</count>
-<relevance>17138</relevance>
-<recid>content: title water supply engineering author folwell amory prescott medium book</recid>
-</hit>
-<hit>
-
-<md-title>Regulations on the disposal of arsenic residuals from drinking water treatment plants</md-title>
+<md-title>The nitrogen permitting and trading plan for Long Island Sound</md-title>
 <md-date>2000</md-date>
-<md-description>&quot;EPA Contract 68-C7-0011, work assignment 0-38.&quot;</md-description>
+<md-description>&quot;In response to Special Act No. 99-6.&quot;</md-description>
 <md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Regulations on the disposal of arsenic residuals from drinking water treatment plants</md-title>
+<md-title>The nitrogen permitting and trading plan for Long Island Sound</md-title>
 <md-date>2000</md-date>
-<md-description>&quot;May 2000.&quot;</md-description>
-<md-description>&quot;EPA/600/R-00/025.&quot;</md-description>
-<md-description>&quot;EPA Contract 68-C7-0011, work assignment 0-38.&quot;</md-description>
-<md-medium>book</md-medium></location>
-<relevance>17089</relevance>
-<recid>content: title regulations on the disposal of arsenic residuals from drinking water treatment plants medium book</recid>
-</hit>
-<hit>
-
-<md-title>A guide to Montana water quality regulation</md-title>
-<md-date>1997</md-date>
-<md-author>Bryan, Michelle</md-author>
-<md-description>&quot;A joint publication of Legislative Environmental Policy Office, Environmental Quality Council [and] Montana University System, Water Center&quot;</md-description>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>A guide to Montana water quality regulation</md-title>
-<md-date>1997</md-date>
-<md-author>Bryan, Michelle</md-author>
-<md-description>&quot;A joint publication of Legislative Environmental Policy Office, Environmental Quality Council [and] Montana University System, Water Center&quot;</md-description>
-<md-medium>book</md-medium></location>
-<relevance>16541</relevance>
-<recid>content: title a guide to montana water quality regulation author bryan michelle medium book</recid>
-</hit>
-<hit>
-
-<md-title>Water technology management</md-title>
-<md-date>2001</md-date>
-<md-description>Collection of articles with reference to India</md-description>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Water technology management</md-title>
-<md-date>2001</md-date>
-<md-description>Collection of articles with reference to India</md-description>
-<md-medium>book</md-medium></location>
-<relevance>16456</relevance>
-<recid>content: title water technology management medium book</recid>
-</hit>
-<hit>
-
-<md-title>Aquatic habitat indicators and their application to water quality objectives within the Clean Water Act</md-title>
-<md-date>1999</md-date>
-<md-author>Bauer, Steve</md-author>
-<md-description>&quot;This document was developed for US Environmental Protection Agency, Region 10, Seattle Washington, with the Idaho Water Resources Institute, University of Idaho.&quot;</md-description>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Aquatic habitat indicators and their application to water quality objectives within the Clean Water Act</md-title>
-<md-date>1999</md-date>
-<md-author>Bauer, Steve</md-author>
-<md-description>&quot;This document was developed for US Environmental Protection Agency, Region 10, Seattle Washington, with the Idaho Water Resources Institute, University of Idaho.&quot;</md-description>
-<md-medium>book</md-medium></location>
-<relevance>16311</relevance>
-<recid>content: title aquatic habitat indicators and their application to water quality objectives within the clean water act author bauer steve medium book</recid>
-</hit>
-<hit>
-
-<md-title>An empirical analysis of water temperature and dissolved oxygen conditions in the Red Deer River</md-title>
-<md-date>1997</md-date>
-<md-author>Saffran, Karen Anita</md-author>
-<md-description>&quot;March 1997.&quot;</md-description>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>An empirical analysis of water temperature and dissolved oxygen conditions in the Red Deer River</md-title>
-<md-date>1997</md-date>
-<md-author>Saffran, Karen Anita</md-author>
-<md-description>&quot;March 1997.&quot;</md-description>
-<md-medium>book</md-medium></location>
-<relevance>16203</relevance>
-<recid>content: title an empirical analysis of water temperature and dissolved oxygen conditions in the red deer river author saffran karen anita medium book</recid>
-</hit>
-<hit>
-
-<md-title>Surface water quality monitoring procedures manual</md-title>
-<md-date>1999</md-date>
-<md-description>&quot;GI-252&quot;--Cover</md-description>
-<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>Surface water quality monitoring procedures manual</md-title>
-<md-date>1999</md-date>
-<md-description>&quot;June 1999.&quot;</md-description>
-<md-description>&quot;GI-252&quot;--Cover</md-description>
+<md-description>Title from cover</md-description>
+<md-description>&quot;January 2000.&quot;</md-description>
+<md-description>&quot;In response to Special Act No. 99-6.&quot;</md-description>
 <md-medium>book</md-medium></location>
-<relevance>15823</relevance>
-<recid>content: title surface water quality monitoring procedures manual medium book</recid>
+<relevance>300000</relevance>
+<recid>content: title the nitrogen permitting and trading plan for long island sound medium book</recid>
 </hit>
 <hit>
 
-<md-title>International Conference on Management of Drinking Water Resources, Chennai, December 3-5, 1997</md-title>
-<md-title-remainder>proceedings</md-title-remainder>
-<md-date>1997</md-date>
+<md-title>Report of the Water commissioners to the Common council of the city of Albany;</md-title>
+<md-date>1872</md-date>
 <md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
-<md-title>International Conference on Management of Drinking Water Resources, Chennai, December 3-5, 1997</md-title>
-<md-title-remainder>proceedings</md-title-remainder>
-<md-date>1997</md-date>
+<md-title>Report of the Water commissioners to the Common council of the city of Albany;</md-title>
+<md-date>1872</md-date>
 <md-medium>book</md-medium></location>
-<relevance>15443</relevance>
-<recid>content: title international conference on management of drinking water resources chennai december medium book</recid>
+<relevance>192857</relevance>
+<recid>content: title report of the water commissioners to the common council of the city of albany medium book</recid>
 </hit>
 </show>
\ No newline at end of file
diff --git a/test/test_solr_23.res b/test/test_solr_23.res
new file mode 100644 (file)
index 0000000..42534e3
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings><status>OK</status></settings>
\ No newline at end of file
diff --git a/test/test_solr_24.res b/test/test_solr_24.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_solr_25.res b/test/test_solr_25.res
new file mode 100644 (file)
index 0000000..83670b4
--- /dev/null
@@ -0,0 +1,311 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>97</merged>
+<total>1995</total>
+<start>0</start>
+<num>20</num>
+<hit>
+
+<md-title>Water</md-title>
+<md-date>1999</md-date>
+<md-author>De Villiers, Marq</md-author>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Water</md-title>
+<md-date>1999</md-date>
+<md-author>De Villiers, Marq</md-author>
+<md-medium>book</md-medium></location>
+<relevance>23233</relevance>
+<recid>content: title water author de villiers marq medium book</recid>
+</hit>
+<hit>
+
+<md-title>Potable water and methods of detecting impurities</md-title>
+<md-date>1899-1906</md-date>
+<md-author>Baker, M. N</md-author>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Potable water and methods of detecting impurities</md-title>
+<md-date>1906</md-date>
+<md-author>Baker, M. N</md-author>
+<md-medium>book</md-medium></location>
+<location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Potable water and methods of detecting impurities</md-title>
+<md-date>1899</md-date>
+<md-author>Baker, M. N</md-author>
+<md-medium>book</md-medium></location>
+<count>2</count>
+<relevance>21645</relevance>
+<recid>content: title potable water and methods of detecting impurities author baker m n medium book</recid>
+</hit>
+<hit>
+
+<md-title>Water</md-title>
+<md-date>2000</md-date>
+<md-author>Majeed, Abdul</md-author>
+<md-description>&quot;Balochistan conservation strategy background paper&quot;--T.p</md-description>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Water</md-title>
+<md-date>2000</md-date>
+<md-author>Majeed, Abdul</md-author>
+<md-description>&quot;Balochistan conservation strategy background paper&quot;--T.p</md-description>
+<md-medium>book</md-medium></location>
+<relevance>20202</relevance>
+<recid>content: title water author majeed abdul medium book</recid>
+</hit>
+<hit>
+
+<md-title>Water</md-title>
+<md-date>2000</md-date>
+<md-author>Grant, Pamela</md-author>
+<md-description>Examines major environmental issues surrounding water, giving examples of attempts to solve global problems and sources for more information</md-description>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Water</md-title>
+<md-date>2000</md-date>
+<md-author>Grant, Pamela</md-author>
+<md-description>Includes index</md-description>
+<md-description>Examines major environmental issues surrounding water, giving examples of attempts to solve global problems and sources for more information</md-description>
+<md-medium>book</md-medium></location>
+<relevance>18501</relevance>
+<recid>content: title water author grant pamela medium book</recid>
+</hit>
+<hit>
+
+<md-title>Water law</md-title>
+<md-date>2000</md-date>
+<md-author>Fisher, D. E</md-author>
+<md-description>Includes index</md-description>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Water law</md-title>
+<md-date>2000</md-date>
+<md-author>Fisher, D. E</md-author>
+<md-description>Includes index</md-description>
+<md-medium>book</md-medium></location>
+<relevance>18182</relevance>
+<recid>content: title water law author fisher d e medium book</recid>
+</hit>
+<hit>
+
+<md-title>A Primer on fresh water</md-title>
+<md-title-remainder>questions and answers</md-title-remainder>
+<md-date>2000</md-date>
+<md-description>Issued also in French under title: Notions élémentaires sur l&apos;eau douce : questions et réponses</md-description>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>A Primer on fresh water</md-title>
+<md-title-remainder>questions and answers</md-title-remainder>
+<md-date>2000</md-date>
+<md-description>Issued also in French under title: Notions élémentaires sur l&apos;eau douce : questions et réponses</md-description>
+<md-description>Includes index</md-description>
+<md-medium>book</md-medium></location>
+<relevance>17576</relevance>
+<recid>content: title a primer on fresh water medium book</recid>
+</hit>
+<hit>
+
+<md-title>Water and water supplies</md-title>
+<md-date>1901</md-date>
+<md-author>Thresh, John Clough</md-author>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Water and water supplies</md-title>
+<md-date>1901</md-date>
+<md-author>Thresh, John Clough</md-author>
+<md-medium>book</md-medium></location>
+<relevance>15152</relevance>
+<recid>content: title water and water supplies author thresh john clough medium book</recid>
+</hit>
+<hit>
+
+<md-title>Water quality assessment of the State Water Project, 1996-97</md-title>
+<md-date>1999-2000</md-date>
+<md-description>&quot;September 1999.&quot;</md-description>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Water quality assessment of the State Water Project, 1998-99</md-title>
+<md-date>2000</md-date>
+<md-description>Cover title</md-description>
+<md-description>&quot;July 2000.&quot;</md-description>
+<md-medium>book</md-medium></location>
+<location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Water quality assessment of the State Water Project, 1996-97</md-title>
+<md-date>1999</md-date>
+<md-description>Cover title</md-description>
+<md-description>&quot;September 1999.&quot;</md-description>
+<md-medium>book</md-medium></location>
+<count>2</count>
+<relevance>15152</relevance>
+<recid>content: title water quality assessment of the state water project medium book</recid>
+</hit>
+<hit>
+
+<md-title>Water-supply</md-title>
+<md-title-remainder>(Considered principally from a sanitary standpoint.)</md-title-remainder>
+<md-date>1896</md-date>
+<md-author>Mason, William Pitt</md-author>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Water-supply</md-title>
+<md-title-remainder>(Considered principally from a sanitary standpoint.)</md-title-remainder>
+<md-date>1896</md-date>
+<md-author>Mason, William Pitt</md-author>
+<md-medium>book</md-medium></location>
+<relevance>15152</relevance>
+<recid>content: title water supply author mason william pitt medium book</recid>
+</hit>
+<hit>
+
+<md-title>The law of waters and water rights</md-title>
+<md-title-remainder>international, national, state, municipal, and individual, including irrigation, drainage, and municipal water supply</md-title-remainder>
+<md-date>1904</md-date>
+<md-author>Farnham, Henry P</md-author>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>The law of waters and water rights</md-title>
+<md-title-remainder>international, national, state, municipal, and individual, including irrigation, drainage, and municipal water supply</md-title-remainder>
+<md-date>1904</md-date>
+<md-author>Farnham, Henry P</md-author>
+<md-medium>book</md-medium></location>
+<relevance>14630</relevance>
+<recid>content: title the law of waters and water rights author farnham henry p medium book</recid>
+</hit>
+<hit>
+
+<md-title>Water, in press, 1998</md-title>
+<md-title-remainder>an index of news items on water resources selected from leading news papers</md-title-remainder>
+<md-date>1998-1999</md-date>
+<md-description>With reference to India</md-description>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Water, in press, 1998</md-title>
+<md-title-remainder>an index to news items on water resources selected from leading news papers</md-title-remainder>
+<md-date>1999</md-date>
+<md-description>Includes index</md-description>
+<md-medium>book</md-medium></location>
+<location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Water in press, 1997</md-title>
+<md-title-remainder>an index of news items on water resources selected from leading news papers</md-title-remainder>
+<md-date>1998</md-date>
+<md-description>Includes index</md-description>
+<md-description>With reference to India</md-description>
+<md-medium>book</md-medium></location>
+<count>2</count>
+<relevance>13675</relevance>
+<recid>content: title water in press medium book</recid>
+</hit>
+<hit>
+
+<md-title>Regulations on the disposal of arsenic residuals from drinking water treatment plants</md-title>
+<md-date>2000</md-date>
+<md-description>&quot;EPA Contract 68-C7-0011, work assignment 0-38.&quot;</md-description>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Regulations on the disposal of arsenic residuals from drinking water treatment plants</md-title>
+<md-date>2000</md-date>
+<md-description>&quot;May 2000.&quot;</md-description>
+<md-description>&quot;EPA/600/R-00/025.&quot;</md-description>
+<md-description>&quot;EPA Contract 68-C7-0011, work assignment 0-38.&quot;</md-description>
+<md-medium>book</md-medium></location>
+<relevance>13636</relevance>
+<recid>content: title regulations on the disposal of arsenic residuals from drinking water treatment plants medium book</recid>
+</hit>
+<hit>
+
+<md-title>A guide to Montana water quality regulation</md-title>
+<md-date>1997</md-date>
+<md-author>Bryan, Michelle</md-author>
+<md-description>&quot;A joint publication of Legislative Environmental Policy Office, Environmental Quality Council [and] Montana University System, Water Center&quot;</md-description>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>A guide to Montana water quality regulation</md-title>
+<md-date>1997</md-date>
+<md-author>Bryan, Michelle</md-author>
+<md-description>&quot;A joint publication of Legislative Environmental Policy Office, Environmental Quality Council [and] Montana University System, Water Center&quot;</md-description>
+<md-medium>book</md-medium></location>
+<relevance>13199</relevance>
+<recid>content: title a guide to montana water quality regulation author bryan michelle medium book</recid>
+</hit>
+<hit>
+
+<md-title>Water technology management</md-title>
+<md-date>2001</md-date>
+<md-description>Collection of articles with reference to India</md-description>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Water technology management</md-title>
+<md-date>2001</md-date>
+<md-description>Collection of articles with reference to India</md-description>
+<md-medium>book</md-medium></location>
+<relevance>13131</relevance>
+<recid>content: title water technology management medium book</recid>
+</hit>
+<hit>
+
+<md-title>Aquatic habitat indicators and their application to water quality objectives within the Clean Water Act</md-title>
+<md-date>1999</md-date>
+<md-author>Bauer, Steve</md-author>
+<md-description>&quot;This document was developed for US Environmental Protection Agency, Region 10, Seattle Washington, with the Idaho Water Resources Institute, University of Idaho.&quot;</md-description>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Aquatic habitat indicators and their application to water quality objectives within the Clean Water Act</md-title>
+<md-date>1999</md-date>
+<md-author>Bauer, Steve</md-author>
+<md-description>&quot;This document was developed for US Environmental Protection Agency, Region 10, Seattle Washington, with the Idaho Water Resources Institute, University of Idaho.&quot;</md-description>
+<md-medium>book</md-medium></location>
+<relevance>13016</relevance>
+<recid>content: title aquatic habitat indicators and their application to water quality objectives within the clean water act author bauer steve medium book</recid>
+</hit>
+<hit>
+
+<md-title>An empirical analysis of water temperature and dissolved oxygen conditions in the Red Deer River</md-title>
+<md-date>1997</md-date>
+<md-author>Saffran, Karen Anita</md-author>
+<md-description>&quot;March 1997.&quot;</md-description>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>An empirical analysis of water temperature and dissolved oxygen conditions in the Red Deer River</md-title>
+<md-date>1997</md-date>
+<md-author>Saffran, Karen Anita</md-author>
+<md-description>&quot;March 1997.&quot;</md-description>
+<md-medium>book</md-medium></location>
+<relevance>12929</relevance>
+<recid>content: title an empirical analysis of water temperature and dissolved oxygen conditions in the red deer river author saffran karen anita medium book</recid>
+</hit>
+<hit>
+
+<md-title>Surface water quality monitoring procedures manual</md-title>
+<md-date>1999</md-date>
+<md-description>&quot;GI-252&quot;--Cover</md-description>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Surface water quality monitoring procedures manual</md-title>
+<md-date>1999</md-date>
+<md-description>&quot;June 1999.&quot;</md-description>
+<md-description>&quot;GI-252&quot;--Cover</md-description>
+<md-medium>book</md-medium></location>
+<relevance>12626</relevance>
+<recid>content: title surface water quality monitoring procedures manual medium book</recid>
+</hit>
+<hit>
+
+<md-title>International Conference on Management of Drinking Water Resources, Chennai, December 3-5, 1997</md-title>
+<md-title-remainder>proceedings</md-title-remainder>
+<md-date>1997</md-date>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>International Conference on Management of Drinking Water Resources, Chennai, December 3-5, 1997</md-title>
+<md-title-remainder>proceedings</md-title-remainder>
+<md-date>1997</md-date>
+<md-medium>book</md-medium></location>
+<relevance>12323</relevance>
+<recid>content: title international conference on management of drinking water resources chennai december medium book</recid>
+</hit>
+<hit>
+
+<md-title>Mercados e instituciones de aguas en Bolivia</md-title>
+<md-date>1998</md-date>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Mercados e instituciones de aguas en Bolivia</md-title>
+<md-date>1998</md-date>
+<md-medium>book</md-medium></location>
+<relevance>12121</relevance>
+<recid>content: title mercados e instituciones de aguas en bolivia medium book</recid>
+</hit>
+<hit>
+
+<md-title>Water law</md-title>
+<md-date>2000</md-date>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Water law</md-title>
+<md-date>2000</md-date>
+<md-medium>book</md-medium></location>
+<relevance>12121</relevance>
+<recid>content: title water law medium book</recid>
+</hit>
+</show>
\ No newline at end of file
diff --git a/test/test_solr_26.res b/test/test_solr_26.res
new file mode 100644 (file)
index 0000000..b709f6e
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bytarget><status>OK</status>
+<target><id>LOC Solr Test</id>
+<name>LOC Solr Test</name>
+<hits>1995</hits>
+<diagnostic>0</diagnostic>
+<records>100</records>
+<state>Client_Idle</state>
+</target></bytarget>
\ No newline at end of file
diff --git a/test/test_solr_27.res b/test/test_solr_27.res
new file mode 100644 (file)
index 0000000..294fe36
--- /dev/null
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<termlist><activeclients>0</activeclients>
+<list name="xtargets">
+<term>
+<id>LOC Solr Test</id>
+<name>LOC Solr Test</name>
+<frequency>1995</frequency>
+<state>Client_Idle</state>
+<diagnostic>0</diagnostic>
+</term>
+</list>
+<list name="subject">
+<term><name>Water-supply</name><frequency>185</frequency></term>
+<term><name>Water</name><frequency>169</frequency></term>
+<term><name>Groundwater</name><frequency>94</frequency></term>
+<term><name>Water resources development</name><frequency>93</frequency></term>
+<term><name>Water quality</name><frequency>87</frequency></term>
+<term><name>Mineral waters</name><frequency>52</frequency></term>
+<term><name>Water quality management</name><frequency>50</frequency></term>
+<term><name>United States</name><frequency>43</frequency></term>
+<term><name>Irrigation</name><frequency>33</frequency></term>
+<term><name>N.Y</name><frequency>28</frequency></term>
+<term><name>Hydraulic engineering</name><frequency>24</frequency></term>
+<term><name>Geology</name><frequency>23</frequency></term>
+<term><name>U.S</name><frequency>23</frequency></term>
+<term><name>Groundwater flow</name><frequency>22</frequency></term>
+<term><name>Birds</name><frequency>21</frequency></term>
+</list>
+<list name="author">
+<term><name>Waters, Clara Erskine Clement</name><frequency>9</frequency></term>
+<term><name>Waters, Henry F</name><frequency>8</frequency></term>
+<term><name>Moorman, J. J</name><frequency>7</frequency></term>
+<term><name>Waters, Thomas Franklin</name><frequency>6</frequency></term>
+<term><name>Basak, P</name><frequency>5</frequency></term>
+<term><name>Bergren, Lisa Tawn</name><frequency>5</frequency></term>
+<term><name>Kingsley, Charles</name><frequency>5</frequency></term>
+<term><name>Tyndall, John</name><frequency>5</frequency></term>
+<term><name>Baldwin, William J</name><frequency>4</frequency></term>
+<term><name>Holme, Charles</name><frequency>4</frequency></term>
+<term><name>James, E. J</name><frequency>4</frequency></term>
+<term><name>Nuttall, Thomas</name><frequency>4</frequency></term>
+<term><name>Walton, George Edward</name><frequency>4</frequency></term>
+<term><name>Wilkins, John H</name><frequency>4</frequency></term>
+<term><name>Arthur, Kay</name><frequency>3</frequency></term>
+</list>
+<list name="date">
+<term><name>2000</name><frequency>411</frequency></term>
+<term><name>1999</name><frequency>318</frequency></term>
+<term><name>1998</name><frequency>90</frequency></term>
+<term><name>2001</name><frequency>87</frequency></term>
+<term><name>1907</name><frequency>50</frequency></term>
+<term><name>1902</name><frequency>46</frequency></term>
+<term><name>1906</name><frequency>43</frequency></term>
+<term><name>1905</name><frequency>39</frequency></term>
+<term><name>1909</name><frequency>39</frequency></term>
+<term><name>1904</name><frequency>36</frequency></term>
+<term><name>1997</name><frequency>35</frequency></term>
+<term><name>1908</name><frequency>33</frequency></term>
+<term><name>1996</name><frequency>32</frequency></term>
+<term><name>1903</name><frequency>30</frequency></term>
+<term><name>1901</name><frequency>29</frequency></term>
+</list>
+<list name="medium">
+<term><name>book</name><frequency>1984</frequency></term>
+<term><name>web</name><frequency>8</frequency></term>
+<term><name>book (electronic)</name><frequency>3</frequency></term>
+</list>
+</termlist>
\ No newline at end of file
diff --git a/test/test_solr_28.res b/test/test_solr_28.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_solr_29.res b/test/test_solr_29.res
new file mode 100644 (file)
index 0000000..00b1fd7
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>2</merged>
+<total>2</total>
+<start>0</start>
+<num>2</num>
+<hit>
+
+<md-title>The nitrogen permitting and trading plan for Long Island Sound</md-title>
+<md-date>2000</md-date>
+<md-description>&quot;In response to Special Act No. 99-6.&quot;</md-description>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>The nitrogen permitting and trading plan for Long Island Sound</md-title>
+<md-date>2000</md-date>
+<md-description>Title from cover</md-description>
+<md-description>&quot;January 2000.&quot;</md-description>
+<md-description>&quot;In response to Special Act No. 99-6.&quot;</md-description>
+<md-medium>book</md-medium></location>
+<relevance>300000</relevance>
+<recid>content: title the nitrogen permitting and trading plan for long island sound medium book</recid>
+</hit>
+<hit>
+
+<md-title>Report of the Water commissioners to the Common council of the city of Albany;</md-title>
+<md-date>1872</md-date>
+<md-medium>book</md-medium><location id="LOC Solr Test" name="LOC Solr Test">
+<md-title>Report of the Water commissioners to the Common council of the city of Albany;</md-title>
+<md-date>1872</md-date>
+<md-medium>book</md-medium></location>
+<relevance>192857</relevance>
+<recid>content: title report of the water commissioners to the common council of the city of albany medium book</recid>
+</hit>
+</show>
\ No newline at end of file
index 631044f..867c513 100644 (file)
@@ -1,4 +1,4 @@
-<!-- Solr target -->
+<!-- Solr target, settings 4-->
 <settings target="LOC Solr Test">
   <set name="pz:maxrecs" value="200" /> 
   <set name="pz:present_chunk" value="0"/>
diff --git a/test/test_solr_settings_5.xml b/test/test_solr_settings_5.xml
new file mode 100644 (file)
index 0000000..2aa611b
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- Solr target, Settings 5 -->
+<settings target="LOC Solr Test">
+  <set name="pz:maxrecs" value="100" /> 
+  <set name="pz:present_chunk" value=""/>
+</settings>
index 16425e2..15ce060 100644 (file)
@@ -5,6 +5,11 @@
     <listen port="9763"/>
     <proxy host="localhost"/>
     
+    <!-- same as hardcoded rule -->
+    <icu_chain id="facet" locale="en">
+      <transliterate>[[:WhiteSpace:][,.!;]]* } [$] > ;</transliterate>
+    </icu_chain>
+
     <service>
       <include src="z3950_indexdata_com_marc.xml"/>
       <metadata name="url" merge="unique"/>
index a362da1..8fe0a37 100644 (file)
   <!-- Result normalization settings -->
 
   <set name="pz:nativesyntax" value="iso2709"/>
-  <set name="pz:xslt" value="marc21_test.xsl"/>
+  <set name="pz:xslt">
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+    xmlns:marc="http://www.loc.gov/MARC21/slim">
+
+    <xsl:param name="test"/>
+  
+  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
+
+<!-- Extract metadata from MARC21/USMARC 
+      http://www.loc.gov/marc/bibliographic/ecbdhome.html
+-->  
+  
+  <xsl:template match="marc:record">
+    <xsl:variable name="title_medium" select="marc:datafield[@tag='245']/marc:subfield[@code='h']"/>
+    <xsl:variable name="journal_title" select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
+    <xsl:variable name="electronic_location_url" select="marc:datafield[@tag='856']/marc:subfield[@code='u']"/>
+    <xsl:variable name="fulltext_a" select="marc:datafield[@tag='900']/marc:subfield[@code='a']"/>
+    <xsl:variable name="fulltext_b" select="marc:datafield[@tag='900']/marc:subfield[@code='b']"/>
+    <xsl:variable name="medium">
+      <xsl:choose>
+       <xsl:when test="$title_medium">
+         <xsl:value-of select="substring-after(substring-before($title_medium,']'),'[')"/>
+       </xsl:when>
+       <xsl:when test="$fulltext_a">
+         <xsl:text>electronic resource</xsl:text>
+       </xsl:when>
+       <xsl:when test="$fulltext_b">
+         <xsl:text>electronic resource</xsl:text>
+       </xsl:when>
+       <xsl:when test="$electronic_location_url">
+         <xsl:text>electronic resource</xsl:text>
+       </xsl:when>
+       <xsl:when test="$journal_title">
+         <xsl:text>article</xsl:text>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:text>book</xsl:text>
+       </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <pz:record>
+      <xsl:attribute name="mergekey">
+        <xsl:text>title </xsl:text>
+       <xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
+       <xsl:text> author </xsl:text>
+       <xsl:value-of select="marc:datafield[@tag='100']/marc:subfield[@code='a']"/>
+       <xsl:text> medium </xsl:text>
+       <xsl:value-of select="$medium"/>
+      </xsl:attribute>
+
+      <pz:metadata type="test-usersetting-2">
+        test-usersetting-2 data: 
+        <xsl:value-of select="$test"/>
+      </pz:metadata>
+
+      <xsl:for-each select="marc:controlfield[@tag='001']">
+        <pz:metadata type="id">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='010']">
+        <pz:metadata type="lccn">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='020']">
+        <pz:metadata type="isbn">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='022']">
+        <pz:metadata type="issn">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='027']">
+        <pz:metadata type="tech-rep-nr">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='100']">
+       <pz:metadata type="author">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="author-title">
+         <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+       <pz:metadata type="author-date">
+         <xsl:value-of select="marc:subfield[@code='d']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='110']">
+       <pz:metadata type="corporate-name">
+           <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="corporate-location">
+           <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+       <pz:metadata type="corporate-date">
+           <xsl:value-of select="marc:subfield[@code='d']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='111']">
+       <pz:metadata type="meeting-name">
+           <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="meeting-location">
+           <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+       <pz:metadata type="meeting-date">
+           <xsl:value-of select="marc:subfield[@code='d']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='260']">
+       <pz:metadata type="date">
+           <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='245']">
+        <pz:metadata type="title">
+          <xsl:value-of select="marc:subfield[@code='a']"/>
+        </pz:metadata>
+        <pz:metadata type="title-remainder">
+          <xsl:value-of select="marc:subfield[@code='b']"/>
+        </pz:metadata>
+        <pz:metadata type="title-responsibility">
+          <xsl:value-of select="marc:subfield[@code='c']"/>
+        </pz:metadata>
+        <pz:metadata type="title-dates">
+          <xsl:value-of select="marc:subfield[@code='f']"/>
+        </pz:metadata>
+        <pz:metadata type="title-medium">
+          <xsl:value-of select="marc:subfield[@code='h']"/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='250']">
+       <pz:metadata type="edition">
+           <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='260']">
+        <pz:metadata type="publication-place">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+        <pz:metadata type="publication-name">
+         <xsl:value-of select="marc:subfield[@code='b']"/>
+       </pz:metadata>
+        <pz:metadata type="publication-date">
+         <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='300']">
+       <pz:metadata type="physical-extent">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-format">
+         <xsl:value-of select="marc:subfield[@code='b']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-dimensions">
+         <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-accomp">
+         <xsl:value-of select="marc:subfield[@code='e']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-unittype">
+         <xsl:value-of select="marc:subfield[@code='f']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-unitsize">
+         <xsl:value-of select="marc:subfield[@code='g']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-specified">
+         <xsl:value-of select="marc:subfield[@code='3']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='440']">
+       <pz:metadata type="series-title">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag &gt;= 500 and @tag &lt;= 599]
+                           [@tag != '506' and @tag != '530' and
+                           @tag != '540' and @tag != '546'
+                            and @tag != '522']">
+        <!-- The tag attribute below will be preserved -->
+       <pz:metadata type="description" tag="{@tag}">
+            <xsl:value-of select="*/text()"/>
+        </pz:metadata>
+      </xsl:for-each>
+      
+      <xsl:for-each select="marc:datafield[@tag='600' or @tag='610' or @tag='611' or @tag='630' or @tag='648' or @tag='650' or @tag='651' or @tag='653' or @tag='654' or @tag='655' or @tag='656' or @tag='657' or @tag='658' or @tag='662' or @tag='69X']">
+       <pz:metadata type="subject">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='856']">
+       <pz:metadata type="electronic-url">
+         <xsl:value-of select="marc:subfield[@code='u']"/>
+       </pz:metadata>
+       <pz:metadata type="electronic-text">
+         <xsl:value-of select="marc:subfield[@code='y']"/>
+       </pz:metadata>
+       <pz:metadata type="electronic-note">
+         <xsl:value-of select="marc:subfield[@code='z']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='773']">
+       <pz:metadata type="citation">
+         <xsl:for-each select="*">
+           <xsl:value-of select="normalize-space(.)"/>
+           <xsl:text> </xsl:text>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <pz:metadata type="medium">
+       <xsl:value-of select="$medium"/>
+      </pz:metadata>
+      
+      <xsl:if test="$fulltext_a">
+       <pz:metadata type="fulltext">
+         <xsl:value-of select="$fulltext_a"/>
+       </pz:metadata>
+      </xsl:if>
+
+      <xsl:if test="$fulltext_b">
+       <pz:metadata type="fulltext">
+         <xsl:value-of select="$fulltext_b"/>
+       </pz:metadata>
+      </xsl:if>
+    </pz:record>
+  </xsl:template>
+</xsl:stylesheet>
+  </set>
   
   <set name="pz:apdulog" value="1"/>
   <set name="pz:pqf_strftime" value="@or %% %Y"/>