int hits;
int record_offset;
int maxrecs;
+ int startrecs;
int diagnostic;
enum client_state state;
struct show_raw *show_raw;
}
else
{
- cl->record_offset = 0;
+ cl->record_offset = cl->startrecs;
cl->hits = ZOOM_resultset_size(resultset);
se->total_hits += cl->hits;
}
}
ZOOM_connection_option_set(link, "count", opt_maxrecs);
+
if (atoi(opt_maxrecs) > 20)
ZOOM_connection_option_set(link, "presentChunk", "20");
else
ZOOM_connection_option_set(link, "presentChunk", opt_maxrecs);
+
+ if (cl->startrecs)
+ {
+ char startrecs_str[24];
+ sprintf(startrecs_str, "%d", cl->startrecs);
+ ZOOM_connection_option_set(link, "start", startrecs_str);
+ }
+
if (databaseName)
ZOOM_connection_option_set(link, "databaseName", databaseName);
else
r = xmalloc(sizeof(struct client));
r->maxrecs = 100;
+ r->startrecs = 0;
r->pquery = 0;
r->cqlquery = 0;
r->database = 0;
cl->maxrecs = v;
}
+void client_set_startrecs(struct client *cl, int v)
+{
+ cl->startrecs = v;
+}
+
/*
* Local variables:
* c-basic-offset: 4
struct host *client_get_host(struct client *cl);
const char *client_get_url(struct client *cl);
void client_set_maxrecs(struct client *cl, int v);
+void client_set_startrecs(struct client *cl, int v);
#endif
const char *query = http_argbyname(rq, "query");
const char *filter = http_argbyname(rq, "filter");
const char *maxrecs = http_argbyname(rq, "maxrecs");
+ const char *startrecs = http_argbyname(rq, "startrecs");
enum pazpar2_error_code code;
const char *addinfo = 0;
error(rs, PAZPAR2_MALFORMED_PARAMETER_ENCODING, "query");
return;
}
- code = search(s->psession, query, maxrecs, filter, &addinfo);
+ code = search(s->psession, query, startrecs, maxrecs, filter, &addinfo);
if (code)
{
error(rs, code, addinfo);
enum pazpar2_error_code search(struct session *se,
const char *query,
- const char *maxrecs,
+ const char *startrecs, const char *maxrecs,
const char *filter,
const char **addinfo)
{
{
if (maxrecs)
client_set_maxrecs(cl, atoi(maxrecs));
+ if (startrecs)
+ client_set_startrecs(cl, atoi(startrecs));
if (prepare_session_database(se, client_get_database(cl)) < 0)
continue;
// Parse query for target
int load_targets(struct session *s, const char *fn);
void statistics(struct session *s, struct statistics *stat);
enum pazpar2_error_code search(struct session *s, const char *query,
- const char *maxrecs,
+ const char *startrecs, const char *maxrecs,
const char *filter, const char **addinfo);
struct record_cluster **show(struct session *s, struct reclist_sortparms *sp, int start,
int *num, int *total, int *sumhits, NMEM nmem_show);
<num>5</num>
<hit>
-<md-title>The Computer Bible</md-title>
-<md-date>1973-1980</md-date>
-<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="z3950.indexdata.com/marc" name="marc">
-<md-title>The Computer Bible</md-title>
-<md-date>1973-1980</md-date>
-<md-description>Hebrew and Greek; introductions in English</md-description>
-<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description>
+<md-title>The religious teachers of Greece</md-title>
+<md-date>1972</md-date>
+<md-author>Adam, James</md-author>
+<md-description>Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description><location id="z3950.indexdata.com/marc" name="marc">
+<md-title>The religious teachers of Greece</md-title>
+<md-date>1972</md-date>
+<md-author>Adam, James</md-author>
+<md-description>Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description>
+<md-description>Includes bibliographical references</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
-<relevance>30000</relevance>
-<recid>title the computer bible author medium book</recid>
+<relevance>48000</relevance>
+<recid>title the religious teachers of greece author adam james medium book</recid>
+</hit>
+<hit>
+
+<md-title>The use of passwords for controlled access to computer resources</md-title>
+<md-date>1977</md-date>
+<md-author>Wood, Helen M</md-author><location id="z3950.indexdata.com/marc" name="marc">
+<md-title>The use of passwords for controlled access to computer resources</md-title>
+<md-date>1977</md-date>
+<md-author>Wood, Helen M</md-author>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data:
+ YYYYYYYYY</md-test-usersetting-2></location>
+<relevance>42857</relevance>
+<recid>title the use of passwords for controlled access to computer resources author wood helen m medium book</recid>
</hit>
<hit>
<relevance>25000</relevance>
<recid>title computer science technology author medium book</recid>
</hit>
-<hit>
-
-<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
-<md-title-remainder>the proceedings of a workshop</md-title-remainder>
-<md-date>1974</md-date>
-<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="marc">
-<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
-<md-title-remainder>the proceedings of a workshop</md-title-remainder>
-<md-date>1974</md-date>
-<md-description>Includes bibliographical references and index</md-description>
-<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
-<md-test-usersetting-2>test-usersetting-2 data:
- YYYYYYYYY</md-test-usersetting-2></location>
-<relevance>17857</relevance>
-<recid>title computer processing of dynamic images from an anger scintillation camera author medium book</recid>
-</hit>
</show>
http://localhost:9763/search.pz2?session=5&command=search&query=computer&filter=pz%3Aid%3Dunknown
http://localhost:9763/search.pz2?session=3&command=settings&pz:maxrecs%5Bz3950.indexdata.com%2Fgils%5D=8
http://localhost:9763/search.pz2?session=3&command=search&query=the
-http://localhost:9763/search.pz2?session=5&command=search&query=the&maxrecs=5
+http://localhost:9763/search.pz2?session=5&command=search&query=the&maxrecs=5&startrecs=2
2
http://localhost:9763/search.pz2?session=3&command=show&start=0&number=1&block=1
http://localhost:9763/search.pz2?session=5&command=show&start=0&number=1&block=1