New GFS search member: present_number
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 10 Jan 2013 10:04:38 +0000 (11:04 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 10 Jan 2013 10:04:38 +0000 (11:04 +0100)
This is a hint to the search handler how many records are going to be
fetched immediately following search. There's no guarantee that it's
going to be the case, since it depends on hit count (for Z39.50
piggyback) and whether errors turn up.

include/yaz/backend.h
src/seshigh.c

index ea2d88b..dd2806c 100644 (file)
@@ -62,7 +62,7 @@ typedef struct {
     ODR decode;                /**< decode stream (input) */
     ODR print;                 /**< print stream (input) */
 
     ODR decode;                /**< decode stream (input) */
     ODR print;                 /**< print stream (input) */
 
-    bend_association association; /**< GFS association / sesssion (input) */
+    bend_association association; /**< GFS association / session (input) */
     Odr_int hits;              /**< hits (output) */
     int errcode;               /**< Diagnostic code / 0 for no error (output) */
     char *errstring;           /**< Additional info (output) */
     Odr_int hits;              /**< hits (output) */
     int errcode;               /**< Diagnostic code / 0 for no error (output) */
     char *errstring;           /**< Additional info (output) */
@@ -75,6 +75,7 @@ typedef struct {
     Z_SRW_extra_arg *extra_args; /**< SRU extra request parameters (input) */
     char *extra_response_data;   /**< SRW extra XML response (output) */
     Z_OtherInformation *search_input; /**< extra search info request (input) */
     Z_SRW_extra_arg *extra_args; /**< SRU extra request parameters (input) */
     char *extra_response_data;   /**< SRW extra XML response (output) */
     Z_OtherInformation *search_input; /**< extra search info request (input) */
+    Odr_int present_number;    /**<  piggyback present number (>0) (input) */
 } bend_search_rr;
 
 /** \brief Information for present handler. Does not replace bend_fetch. */
 } bend_search_rr;
 
 /** \brief Information for present handler. Does not replace bend_fetch. */
@@ -87,7 +88,7 @@ typedef struct {
     Z_RecordComposition *comp; /**< Formatting instructions (input) */
     ODR stream;                /**< encoding stream (input) */
     ODR print;                 /**< printing stream (input) */
     Z_RecordComposition *comp; /**< Formatting instructions (input) */
     ODR stream;                /**< encoding stream (input) */
     ODR print;                 /**< printing stream (input) */
-    bend_association association; /**< GFS association / sesssion (input) */
+    bend_association association; /**< GFS association / session (input) */
 
     int errcode;               /**< Diagnostic code / 0 for no error (output) */
     char *errstring;           /**< Additional info (output) */
 
     int errcode;               /**< Diagnostic code / 0 for no error (output) */
     char *errstring;           /**< Additional info (output) */
index ce6fbb7..223239f 100644 (file)
@@ -896,6 +896,8 @@ static void srw_bend_search(association *assoc,
         rr.query->u.type_1 = 0;
         rr.extra_args = sr->extra_args;
         rr.extra_response_data = 0;
         rr.query->u.type_1 = 0;
         rr.extra_args = sr->extra_args;
         rr.extra_response_data = 0;
+        rr.present_number = srw_req->maximumRecords ?
+            *srw_req->maximumRecords : 0;
 
         if (srw_req->query_type == Z_SRW_query_type_cql)
         {
 
         if (srw_req->query_type == Z_SRW_query_type_cql)
         {
@@ -2650,6 +2652,7 @@ static Z_APDU *process_searchRequest(association *assoc, request *reqb)
         bsrr->errstring = NULL;
         bsrr->search_info = NULL;
         bsrr->search_input = req->otherInfo;
         bsrr->errstring = NULL;
         bsrr->search_info = NULL;
         bsrr->search_input = req->otherInfo;
+        bsrr->present_number = *req->mediumSetPresentNumber;
 
         if (assoc->server && assoc->server->cql_transform
             && req->query->which == Z_Query_type_104
 
         if (assoc->server && assoc->server->cql_transform
             && req->query->which == Z_Query_type_104