Change semantics of pz:extendrecs
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 3 Apr 2013 10:55:18 +0000 (12:55 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 3 Apr 2013 10:55:18 +0000 (12:55 +0200)
and allow for repeated fetches . pz:extendrecs is now the number
of extra records to fetch (was total count before).

doc/pazpar2_conf.xml
src/client.c
test/gils_service.xml
test/test_http_28.res
test/test_http_41.res

index bcdf8ec..6f4f3e0 100644 (file)
      <listitem>
       <para>
        If a show command goes to the boundary of a result set for a
-       database - depends on sorting - and pz:extendrecs is set to a larger
-       value of pz:maxrecs, then Pazpar2 wait for show to fetch remaining
-       records - up to pz:extendrecs. This setting is best used if a
+       database - depends on sorting - and pz:extendrecs is set to a positive
+       value. then Pazpar2 wait for show to fetch pz:extendrecs more
+       records. This setting is best used if a
        database does native sorting, because the result set otherwise may
        be completely re-sorted during extended fetch.
       </para>
-      <note>
+      <warning>
        <para>
-       The pz:extendrecs setting is supported in Pazpar2 version 1.6.26.
+       The pz:extendrecs setting appeared in Pazpar2 version 1.6.26.
+       But the bahavior changed with the release of Pazpar2 1.6.29.
        </para>
-      </note>
+      </warning>
      </listitem>
     </varlistentry>
     <varlistentry>
index c13d858..2002c69 100644 (file)
@@ -777,7 +777,7 @@ int client_fetch_more(struct client *cl)
     struct session_database *sdb = client_get_database(cl);
     const char *str;
     int extend_recs = 0;
-    int number;
+    int number = cl->hits - cl->record_offset;
 
     str = session_setting_oneval(sdb, PZ_EXTENDRECS);
     if (!str || !*str)
@@ -791,10 +791,8 @@ int client_fetch_more(struct client *cl)
         return 0;
     yaz_log(YLOG_LOG, "cl=%s Trying to fetch more", client_get_id(cl));
 
-    if (extend_recs > cl->hits)
-        extend_recs = cl->hits;
-
-    number = extend_recs - cl->record_offset;
+    if (number > extend_recs)
+        number = extend_recs;
     if (number > 0)
     {
         ZOOM_resultset set = cl->resultset;
index 984bab6..50796eb 100644 (file)
@@ -23,7 +23,7 @@
        <set name="pz:apdulog" value="1"/>
 
        <set name="pz:maxrecs" value="3" />
-       <set name="pz:extendrecs" value="6" />
+       <set name="pz:extendrecs" value="3" />
       </settings>
 
       <metadata name="url" merge="unique"/>
index f14ba5c..8161687 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <show><status>OK</status>
-<activeclients>0</activeclients>
+<activeclients>1</activeclients>
 <merged>6</merged>
 <total>17</total>
 <start>0</start>
index 2a6fcee..e7568c7 100644 (file)
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <show><status>OK</status>
-<activeclients>0</activeclients>
-<merged>8</merged>
+<activeclients>1</activeclients>
+<merged>11</merged>
 <total>31</total>
 <start>0</start>
-<num>8</num>
+<num>11</num>
 <hit>
  <md-title>APPLIED GEOLOGY FILE</md-title>
  <location id="z3950.indexdata.com/gils"
  <relevance>0</relevance>
  <relevance_info>
 relevance = 0;
-idf[1] = log(((1 + total(8))/termoccur(0));
+idf[1] = log(((1 + total(11))/termoccur(0));
 the: relevance += 100000 * tf[1](0.000000) * idf[1](0.000000) (0);
 score = relevance(0);
  </relevance_info>
  <recid>content: title applied geology file author medium book</recid>
 </hit>
 <hit>
+ <md-title>CORE AND CUTTINGS IN NBMG &apos;LIBRARY&apos;</md-title>
+ <location id="z3950.indexdata.com/gils"
+    name="Index Data GILS test server" checksum="3293507132">
+  <md-title>CORE AND CUTTINGS IN NBMG &apos;LIBRARY&apos;</md-title>
+ </location>
+ <count>1</count>
+ <relevance>0</relevance>
+ <relevance_info>
+relevance = 0;
+idf[1] = log(((1 + total(11))/termoccur(0));
+the: relevance += 100000 * tf[1](0.000000) * idf[1](0.000000) (0);
+score = relevance(0);
+ </relevance_info>
+ <recid>content: title core and cuttings in nbmg library author medium book</recid>
+</hit>
+<hit>
  <md-title>ELECTRIC LOG LIBRARY</md-title>
  <location id="z3950.indexdata.com/gils"
     name="Index Data GILS test server" checksum="2770930265">
@@ -31,7 +47,7 @@ score = relevance(0);
  <relevance>0</relevance>
  <relevance_info>
 relevance = 0;
-idf[1] = log(((1 + total(8))/termoccur(0));
+idf[1] = log(((1 + total(11))/termoccur(0));
 the: relevance += 100000 * tf[1](0.000000) * idf[1](0.000000) (0);
 score = relevance(0);
  </relevance_info>
@@ -47,7 +63,7 @@ score = relevance(0);
  <relevance>0</relevance>
  <relevance_info>
 relevance = 0;
-idf[1] = log(((1 + total(8))/termoccur(0));
+idf[1] = log(((1 + total(11))/termoccur(0));
 the: relevance += 100000 * tf[1](0.000000) * idf[1](0.000000) (0);
 score = relevance(0);
  </relevance_info>
@@ -63,13 +79,45 @@ score = relevance(0);
  <relevance>0</relevance>
  <relevance_info>
 relevance = 0;
-idf[1] = log(((1 + total(8))/termoccur(0));
+idf[1] = log(((1 + total(11))/termoccur(0));
 the: relevance += 100000 * tf[1](0.000000) * idf[1](0.000000) (0);
 score = relevance(0);
  </relevance_info>
  <recid>content: title mine map index author medium book</recid>
 </hit>
 <hit>
+ <md-title>MINERAL OCCURRENCES, DEPOSITS, PROSPECTS, AND MINES</md-title>
+ <location id="z3950.indexdata.com/gils"
+    name="Index Data GILS test server" checksum="3119314843">
+  <md-title>MINERAL OCCURRENCES, DEPOSITS, PROSPECTS, AND MINES</md-title>
+ </location>
+ <count>1</count>
+ <relevance>0</relevance>
+ <relevance_info>
+relevance = 0;
+idf[1] = log(((1 + total(11))/termoccur(0));
+the: relevance += 100000 * tf[1](0.000000) * idf[1](0.000000) (0);
+score = relevance(0);
+ </relevance_info>
+ <recid>content: title mineral occurrences deposits prospects and mines author medium book</recid>
+</hit>
+<hit>
+ <md-title>THESES ON NEVADA GEOLOGY</md-title>
+ <location id="z3950.indexdata.com/gils"
+    name="Index Data GILS test server" checksum="3467699421">
+  <md-title>THESES ON NEVADA GEOLOGY</md-title>
+ </location>
+ <count>1</count>
+ <relevance>0</relevance>
+ <relevance_info>
+relevance = 0;
+idf[1] = log(((1 + total(11))/termoccur(0));
+the: relevance += 100000 * tf[1](0.000000) * idf[1](0.000000) (0);
+score = relevance(0);
+ </relevance_info>
+ <recid>content: title theses on nevada geology author medium book</recid>
+</hit>
+<hit>
  <md-title>UTAH CRIB FILE</md-title>
  <location id="z3950.indexdata.com/gils"
     name="Index Data GILS test server" checksum="2248353398">
@@ -79,7 +127,7 @@ score = relevance(0);
  <relevance>0</relevance>
  <relevance_info>
 relevance = 0;
-idf[1] = log(((1 + total(8))/termoccur(0));
+idf[1] = log(((1 + total(11))/termoccur(0));
 the: relevance += 100000 * tf[1](0.000000) * idf[1](0.000000) (0);
 score = relevance(0);
  </relevance_info>
@@ -95,7 +143,7 @@ score = relevance(0);
  <relevance>0</relevance>
  <relevance_info>
 relevance = 0;
-idf[1] = log(((1 + total(8))/termoccur(0));
+idf[1] = log(((1 + total(11))/termoccur(0));
 the: relevance += 100000 * tf[1](0.000000) * idf[1](0.000000) (0);
 score = relevance(0);
  </relevance_info>
@@ -111,7 +159,7 @@ score = relevance(0);
  <relevance>0</relevance>
  <relevance_info>
 relevance = 0;
-idf[1] = log(((1 + total(8))/termoccur(0));
+idf[1] = log(((1 + total(11))/termoccur(0));
 the: relevance += 100000 * tf[1](0.000000) * idf[1](0.000000) (0);
 score = relevance(0);
  </relevance_info>
@@ -127,7 +175,7 @@ score = relevance(0);
  <relevance>0</relevance>
  <relevance_info>
 relevance = 0;
-idf[1] = log(((1 + total(8))/termoccur(0));
+idf[1] = log(((1 + total(11))/termoccur(0));
 the: relevance += 100000 * tf[1](0.000000) * idf[1](0.000000) (0);
 score = relevance(0);
  </relevance_info>