From ccb068efa655ace7835a122c1226356f2f933992 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 20 May 2003 08:22:32 +0000 Subject: [PATCH] ZOOM option: step. More verbose GFS SRW server display --- CHANGELOG | 3 +++ debian/changelog | 7 +++++++ doc/zoom.xml | 6 +++++- server/seshigh.c | 24 +++++++++++++----------- zutil/zoom-c.c | 12 ++++++++---- zutil/zoom-p.h | 3 ++- 6 files changed, 38 insertions(+), 17 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1db6dd1..d7331c2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ Possible compatibility problems with earlier versions marked with '*'. +New ZOOM option "step" which specifies number of records to be +retrieved in one chunk. Used in conjunction with "start" and "count". + SRW support for yaz-client. yaz-client no longer does (un)intelligent character set conversions diff --git a/debian/changelog b/debian/changelog index c59054e..ef770ac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +yaz (2.0.2-3) unstable; urgency=low + + * SRW support for YAZ client. + * Minor updates to documenation Makefiles. + + -- Adam Dickmeiss Mon, 19 May 2003 23:41:59 +0200 + yaz (2.0.2-2) unstable; urgency=low * yaz.7 moved from yaz to libyaz. diff --git a/doc/zoom.xml b/doc/zoom.xml index ff97c78..00592b7 100644 --- a/doc/zoom.xml +++ b/doc/zoom.xml @@ -1,4 +1,4 @@ - + ZOOM &zoom; is an acronym for 'Z39.50 Object-Orientation Model' and is @@ -360,6 +360,10 @@ countNumber of records to be retrieved. 0 + stepNumber of records to be retrieved in + one chunk. The value, 0 means unchunked. + 0 + elementSetNameElement-Set name of records. Most targets should honor element set name B and F for brief and full respectively. diff --git a/server/seshigh.c b/server/seshigh.c index f2a9bfb..601ff57 100644 --- a/server/seshigh.c +++ b/server/seshigh.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2003, Index Data * See the file LICENSE for details. * - * $Id: seshigh.c,v 1.155 2003-04-29 21:20:33 adam Exp $ + * $Id: seshigh.c,v 1.156 2003-05-20 08:22:33 adam Exp $ */ /* @@ -658,20 +658,22 @@ static void srw_bend_search(association *assoc, request *req, } else { + int number = srw_req->maximumRecords ? *srw_req->maximumRecords : 0; + int start = srw_req->startRecord ? *srw_req->startRecord : 1; + + yaz_log(LOG_LOG, "Request to pack %d+%d out of %d", + start, number, rr.hits); + srw_res->numberOfRecords = odr_intdup(assoc->encode, rr.hits); - if (srw_req->maximumRecords && *srw_req->maximumRecords > 0) + if (number > 0) { - int number = *srw_req->maximumRecords; - int start = 1; int i; - if (srw_req->startRecord) - start = *srw_req->startRecord; - - yaz_log(LOG_DEBUG, "srw_bend_search. start=%d max=%d", - start, *srw_req->maximumRecords); - - if (start <= rr.hits) + if (start > rr.hits) + { + yaz_log(LOG_LOG, "Request out or range"); + } + else { int j = 0; int packing = Z_SRW_recordPacking_string; diff --git a/zutil/zoom-c.c b/zutil/zoom-c.c index 29950e8..578c57f 100644 --- a/zutil/zoom-c.c +++ b/zutil/zoom-c.c @@ -2,7 +2,7 @@ * Copyright (c) 2000-2003, Index Data * See the file LICENSE for details. * - * $Id: zoom-c.c,v 1.34 2003-05-14 20:58:07 adam Exp $ + * $Id: zoom-c.c,v 1.35 2003-05-20 08:22:33 adam Exp $ * * ZOOM layer for C, connections, result sets, queries. */ @@ -508,6 +508,7 @@ ZOOM_resultset ZOOM_resultset_create () r->setname = 0; r->schema = 0; r->count = 0; + r->step = 0; r->record_cache = 0; r->r_sort_spec = 0; r->query = 0; @@ -543,6 +544,7 @@ ZOOM_connection_search(ZOOM_connection c, ZOOM_query q) r->start = ZOOM_options_get_int(r->options, "start", 0); r->count = ZOOM_options_get_int(r->options, "count", 0); + r->step = ZOOM_options_get_int(r->options, "step", 0); r->piggyback = ZOOM_options_get_bool (r->options, "piggyback", 1); cp = ZOOM_options_get (r->options, "setname"); if (cp) @@ -1117,7 +1119,8 @@ static zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c) return zoom_complete; } sr->u.request->startRecord = odr_intdup (c->odr_out, resultset->start + 1); - sr->u.request->maximumRecords = odr_intdup (c->odr_out, resultset->count); + sr->u.request->maximumRecords = odr_intdup ( + c->odr_out, resultset->step>0 ? resultset->step : resultset->count); sr->u.request->recordSchema = resultset->schema; recordPacking = ZOOM_resultset_option_get (resultset, "recordPacking"); @@ -1191,7 +1194,7 @@ static zoom_ret ZOOM_connection_send_search (ZOOM_connection c) /* Regular piggyback - do it unless we're going to do sort */ *search_req->largeSetLowerBound = 2000000000; *search_req->smallSetUpperBound = 0; - *search_req->mediumSetPresentNumber = r->count; + *search_req->mediumSetPresentNumber = r->step>0 ? r->step : r->count; smallSetElementSetName = 0; } else @@ -1814,7 +1817,8 @@ static zoom_ret send_present (ZOOM_connection c) resultset->start += i; resultset->count -= i; *req->resultSetStartPoint = resultset->start + 1; - *req->numberOfRecordsRequested = resultset->count; + *req->numberOfRecordsRequested = resultset->step>0 ? + resultset->step : resultset->count; assert (*req->numberOfRecordsRequested > 0); if (syntax && *syntax) diff --git a/zutil/zoom-p.h b/zutil/zoom-p.h index 38412a3..68faf1e 100644 --- a/zutil/zoom-p.h +++ b/zutil/zoom-p.h @@ -1,6 +1,6 @@ /* * Private C header for ZOOM C. - * $Id: zoom-p.h,v 1.6 2003-02-20 15:11:58 adam Exp $ + * $Id: zoom-p.h,v 1.7 2003-05-20 08:22:33 adam Exp $ */ #if HAVE_XSLT @@ -88,6 +88,7 @@ struct ZOOM_resultset_p { int size; int start; int count; + int step; int piggyback; char *setname; char *schema; -- 1.7.10.4