From: Adam Dickmeiss Date: Fri, 9 Oct 2009 18:11:50 +0000 (+0200) Subject: Adjust presentChunk for low value of pz:maxrecs X-Git-Tag: v1.2.2~13 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=333741ffa692eab0ff5a9c895585691ea6ae3f87;p=pazpar2-moved-to-github.git Adjust presentChunk for low value of pz:maxrecs Set presentChunk to pz:maxrecs if that is lower than 20 (default value of presentChunk). --- diff --git a/src/client.c b/src/client.c index b34cb60..716651c 100644 --- a/src/client.c +++ b/src/client.c @@ -517,15 +517,18 @@ void client_start_search(struct client *cl) ZOOM_connection_option_set(link, "elementSetName", opt_elements); if (*opt_requestsyn) ZOOM_connection_option_set(link, "preferredRecordSyntax", opt_requestsyn); - if (*opt_maxrecs) - ZOOM_connection_option_set(link, "count", opt_maxrecs); - else - ZOOM_connection_option_set(link, "count", "100"); + if (!*opt_maxrecs) + opt_maxrecs = "100"; + + ZOOM_connection_option_set(link, "count", opt_maxrecs); if (databaseName) ZOOM_connection_option_set(link, "databaseName", databaseName); - ZOOM_connection_option_set(link, "presentChunk", "20"); + if (atoi(opt_maxrecs) > 20) + ZOOM_connection_option_set(link, "presentChunk", "20"); + else + ZOOM_connection_option_set(link, "presentChunk", opt_maxrecs); if (cl->cqlquery) {