char *cqlquery; // used for SRU targets only
int hits;
int record_offset;
+ int maxrecs;
int diagnostic;
enum client_state state;
struct show_raw *show_raw;
const char *opt_maxrecs = session_setting_oneval(sdb, PZ_MAXRECS);
const char *opt_sru = session_setting_oneval(sdb, PZ_SRU);
const char *opt_sort = session_setting_oneval(sdb, PZ_SORT);
+ char maxrecs_str[24];
assert(link);
ZOOM_connection_option_set(link, "elementSetName", opt_elements);
if (*opt_requestsyn)
ZOOM_connection_option_set(link, "preferredRecordSyntax", opt_requestsyn);
- if (!*opt_maxrecs)
- opt_maxrecs = "100";
+ if (!*opt_maxrecs)
+ {
+ sprintf(maxrecs_str, "%d", cl->maxrecs);
+ opt_maxrecs = maxrecs_str;
+ }
ZOOM_connection_option_set(link, "count", opt_maxrecs);
- if (databaseName)
- ZOOM_connection_option_set(link, "databaseName", databaseName);
-
if (atoi(opt_maxrecs) > 20)
ZOOM_connection_option_set(link, "presentChunk", "20");
else
ZOOM_connection_option_set(link, "presentChunk", opt_maxrecs);
+ if (databaseName)
+ ZOOM_connection_option_set(link, "databaseName", databaseName);
+
if (cl->cqlquery)
{
ZOOM_query q = ZOOM_query_create();
}
else
r = xmalloc(sizeof(struct client));
+ r->maxrecs = 100;
r->pquery = 0;
r->cqlquery = 0;
r->database = 0;
return client_get_database(cl)->database->url;
}
+void client_set_maxrecs(struct client *cl, int v)
+{
+ cl->maxrecs = v;
+}
+
/*
* Local variables:
* c-basic-offset: 4
void client_set_database(struct client *cl, struct session_database *db);
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);
#endif
struct http_session *s = locate_session(rq, rs);
const char *query = http_argbyname(rq, "query");
const char *filter = http_argbyname(rq, "filter");
+ const char *maxrecs = http_argbyname(rq, "maxrecs");
enum pazpar2_error_code code;
const char *addinfo = 0;
error(rs, PAZPAR2_MALFORMED_PARAMETER_ENCODING, "query");
return;
}
- code = search(s->psession, query, filter, &addinfo);
+ code = search(s->psession, query, maxrecs, filter, &addinfo);
if (code)
{
error(rs, code, addinfo);
}
enum pazpar2_error_code search(struct session *se,
- const char *query, const char *filter,
+ const char *query,
+ const char *maxrecs,
+ const char *filter,
const char **addinfo)
{
int live_channels = 0;
for (cl = se->clients; cl; cl = client_next_in_session(cl))
{
+ if (maxrecs)
+ client_set_maxrecs(cl, atoi(maxrecs));
if (prepare_session_database(se, client_get_database(cl)) < 0)
continue;
// Parse query for target
void session_init_databases(struct session *s);
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,
+enum pazpar2_error_code search(struct session *s, const char *query,
+ 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);
<?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
-<activeclients>0</activeclients>
-<merged>8</merged>
-<total>30</total>
-<start>0</start>
-<num>8</num>
-<hit>
-
-<md-title>UTAH EARTHQUAKE EPICENTERS</md-title><location id="z3950.indexdata.com/gils" name="Index Data GILS test server">
-<md-title>UTAH EARTHQUAKE EPICENTERS</md-title></location>
-<relevance>0</relevance>
-<recid>title utah earthquake epicenters author medium book</recid>
-</hit>
-<hit>
-
-<md-title>UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS</md-title><location id="z3950.indexdata.com/gils" name="Index Data GILS test server">
-<md-title>UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS</md-title></location>
-<relevance>0</relevance>
-<recid>title utah geological and mineral survey publications author medium book</recid>
-</hit>
-<hit>
-
-<md-title>APPLIED GEOLOGY FILE</md-title><location id="z3950.indexdata.com/gils" name="Index Data GILS test server">
-<md-title>APPLIED GEOLOGY FILE</md-title></location>
-<relevance>0</relevance>
-<recid>title applied geology file author medium book</recid>
-</hit>
-<hit>
-
-<md-title>UTAH CRIB FILE</md-title><location id="z3950.indexdata.com/gils" name="Index Data GILS test server">
-<md-title>UTAH CRIB FILE</md-title></location>
-<relevance>0</relevance>
-<recid>title utah crib file author medium book</recid>
-</hit>
-<hit>
-
-<md-title>MINE MAP INDEX</md-title><location id="z3950.indexdata.com/gils" name="Index Data GILS test server">
-<md-title>MINE MAP INDEX</md-title></location>
-<relevance>0</relevance>
-<recid>title mine map index author medium book</recid>
-</hit>
-<hit>
-
-<md-title>UTAH GEOLOGIC MAP BIBLIOGRAPHY</md-title><location id="z3950.indexdata.com/gils" name="Index Data GILS test server">
-<md-title>UTAH GEOLOGIC MAP BIBLIOGRAPHY</md-title></location>
-<relevance>0</relevance>
-<recid>title utah geologic map bibliography author medium book</recid>
-</hit>
-<hit>
-
-<md-title>ELECTRIC LOG LIBRARY</md-title><location id="z3950.indexdata.com/gils" name="Index Data GILS test server">
-<md-title>ELECTRIC LOG LIBRARY</md-title></location>
-<relevance>0</relevance>
-<recid>title electric log library author medium book</recid>
-</hit>
-<hit>
-
-<md-title>ISOTOPIC DATES OF ROCKS AND MINERALS</md-title><location id="z3950.indexdata.com/gils" name="Index Data GILS test server">
-<md-title>ISOTOPIC DATES OF ROCKS AND MINERALS</md-title></location>
-<relevance>0</relevance>
-<recid>title isotopic dates of rocks and minerals author medium book</recid>
-</hit>
-</show>
+<search><status>OK</status></search>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<show>
+<status>OK</status>
+<activeclients>0</activeclients>
+<merged>8</merged>
+<total>30</total>
+<start>0</start>
+<num>8</num>
+<hit>
+
+<md-title>UTAH EARTHQUAKE EPICENTERS</md-title><location id="z3950.indexdata.com/gils" name="Index Data GILS test server">
+<md-title>UTAH EARTHQUAKE EPICENTERS</md-title></location>
+<relevance>0</relevance>
+<recid>title utah earthquake epicenters author medium book</recid>
+</hit>
+<hit>
+
+<md-title>UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS</md-title><location id="z3950.indexdata.com/gils" name="Index Data GILS test server">
+<md-title>UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS</md-title></location>
+<relevance>0</relevance>
+<recid>title utah geological and mineral survey publications author medium book</recid>
+</hit>
+<hit>
+
+<md-title>APPLIED GEOLOGY FILE</md-title><location id="z3950.indexdata.com/gils" name="Index Data GILS test server">
+<md-title>APPLIED GEOLOGY FILE</md-title></location>
+<relevance>0</relevance>
+<recid>title applied geology file author medium book</recid>
+</hit>
+<hit>
+
+<md-title>UTAH CRIB FILE</md-title><location id="z3950.indexdata.com/gils" name="Index Data GILS test server">
+<md-title>UTAH CRIB FILE</md-title></location>
+<relevance>0</relevance>
+<recid>title utah crib file author medium book</recid>
+</hit>
+<hit>
+
+<md-title>MINE MAP INDEX</md-title><location id="z3950.indexdata.com/gils" name="Index Data GILS test server">
+<md-title>MINE MAP INDEX</md-title></location>
+<relevance>0</relevance>
+<recid>title mine map index author medium book</recid>
+</hit>
+<hit>
+
+<md-title>UTAH GEOLOGIC MAP BIBLIOGRAPHY</md-title><location id="z3950.indexdata.com/gils" name="Index Data GILS test server">
+<md-title>UTAH GEOLOGIC MAP BIBLIOGRAPHY</md-title></location>
+<relevance>0</relevance>
+<recid>title utah geologic map bibliography author medium book</recid>
+</hit>
+<hit>
+
+<md-title>ELECTRIC LOG LIBRARY</md-title><location id="z3950.indexdata.com/gils" name="Index Data GILS test server">
+<md-title>ELECTRIC LOG LIBRARY</md-title></location>
+<relevance>0</relevance>
+<recid>title electric log library author medium book</recid>
+</hit>
+<hit>
+
+<md-title>ISOTOPIC DATES OF ROCKS AND MINERALS</md-title><location id="z3950.indexdata.com/gils" name="Index Data GILS test server">
+<md-title>ISOTOPIC DATES OF ROCKS AND MINERALS</md-title></location>
+<relevance>0</relevance>
+<recid>title isotopic dates of rocks and minerals author medium book</recid>
+</hit>
+</show>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<show>
+<status>OK</status>
+<activeclients>0</activeclients>
+<merged>5</merged>
+<total>11</total>
+<start>0</start>
+<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-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>
+</hit>
+<hit>
+
+<md-title>The Puget Sound Region</md-title>
+<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
+<md-date>1974</md-date>
+<md-author>Mairs, John W</md-author>
+<md-description>Scale of maps ca. 1:1,000,000</md-description><location id="z3950.indexdata.com/marc" name="marc">
+<md-title>The Puget Sound Region</md-title>
+<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
+<md-date>1974</md-date>
+<md-author>Mairs, John W</md-author>
+<md-description>Scale of maps ca. 1:1,000,000</md-description>
+<md-description>Bibliography: p. 4</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 puget sound region author mairs john w medium book</recid>
+</hit>
+<hit>
+
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date>
+<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="marc">
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</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>27777</relevance>
+<recid>title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book</recid>
+</hit>
+<hit>
+
+<md-title>Computer science & technology</md-title>
+<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
+<md-date>1977</md-date><location id="z3950.indexdata.com/marc" name="marc">
+<md-title>Computer science & technology</md-title>
+<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
+<md-date>1977</md-date>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data:
+ YYYYYYYYY</md-test-usersetting-2></location>
+<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
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