From 2eae70672f1e8ca9341a51c056469d8816a5538b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 3 Apr 2013 12:55:18 +0200 Subject: [PATCH] Change semantics of pz:extendrecs and allow for repeated fetches . pz:extendrecs is now the number of extra records to fetch (was total count before). --- doc/pazpar2_conf.xml | 13 ++++----- src/client.c | 8 +++--- test/gils_service.xml | 2 +- test/test_http_28.res | 2 +- test/test_http_41.res | 70 +++++++++++++++++++++++++++++++++++++++++-------- 5 files changed, 71 insertions(+), 24 deletions(-) diff --git a/doc/pazpar2_conf.xml b/doc/pazpar2_conf.xml index bcdf8ec..6f4f3e0 100644 --- a/doc/pazpar2_conf.xml +++ b/doc/pazpar2_conf.xml @@ -1278,17 +1278,18 @@ 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. - + - 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. - + diff --git a/src/client.c b/src/client.c index c13d858..2002c69 100644 --- a/src/client.c +++ b/src/client.c @@ -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; diff --git a/test/gils_service.xml b/test/gils_service.xml index 984bab6..50796eb 100644 --- a/test/gils_service.xml +++ b/test/gils_service.xml @@ -23,7 +23,7 @@ - + diff --git a/test/test_http_28.res b/test/test_http_28.res index f14ba5c..8161687 100644 --- a/test/test_http_28.res +++ b/test/test_http_28.res @@ -1,6 +1,6 @@ OK -0 +1 6 17 0 diff --git a/test/test_http_41.res b/test/test_http_41.res index 2a6fcee..e7568c7 100644 --- a/test/test_http_41.res +++ b/test/test_http_41.res @@ -1,10 +1,10 @@ OK -0 -8 +1 +11 31 0 -8 +11 APPLIED GEOLOGY FILE 0 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); content: title applied geology file author medium book + CORE AND CUTTINGS IN NBMG 'LIBRARY' + + CORE AND CUTTINGS IN NBMG 'LIBRARY' + + 1 + 0 + +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); + + content: title core and cuttings in nbmg library author medium book + + ELECTRIC LOG LIBRARY @@ -31,7 +47,7 @@ score = relevance(0); 0 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); @@ -47,7 +63,7 @@ score = relevance(0); 0 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); @@ -63,13 +79,45 @@ score = relevance(0); 0 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); content: title mine map index author medium book + MINERAL OCCURRENCES, DEPOSITS, PROSPECTS, AND MINES + + MINERAL OCCURRENCES, DEPOSITS, PROSPECTS, AND MINES + + 1 + 0 + +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); + + content: title mineral occurrences deposits prospects and mines author medium book + + + THESES ON NEVADA GEOLOGY + + THESES ON NEVADA GEOLOGY + + 1 + 0 + +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); + + content: title theses on nevada geology author medium book + + UTAH CRIB FILE @@ -79,7 +127,7 @@ score = relevance(0); 0 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); @@ -95,7 +143,7 @@ score = relevance(0); 0 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); @@ -111,7 +159,7 @@ score = relevance(0); 0 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); @@ -127,7 +175,7 @@ score = relevance(0); 0 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); -- 1.7.10.4